How to enable in Atom C++ syntax linter for .ino file? (arduino-upload)

atom

il y a 4 mois

Hello everyone , how to enable in  Atom, C++ syntax linter for .ino files? I am using Arduino-upload extension which shows the errors but I want that feature to be while typing like in Eclipse/Visual Studio.

OS:Ubuntu 18.04

Thanks

Steph

NEW il y a 4 mois

Try one of these two, for example (depends on the compiler you use):

Personally, I use Visual Studio Code instead.
And bfx did a great tutorial on the subject!

atom

il y a 4 mois

I have enabled linter-gcc2  and it works for .cpp files only

atom

NEW il y a 4 mois

Steph Steph

I have enabled linter-gcc2  and it works for .cpp files only

Steph

il y a 4 mois

Is there no way to configure the type of files it's supposed to examine?

Otherwise, for Atom, I found something that might interest you: the platform.io plugin that works with the framework of the same name (PlatformIO), which replaces the Arduino IDE. I checked, the SAMD21G18A card is supported (it is the same card as the Gamebuino META).

Take a look at this post, you'll probably find what you need.

I haven't tried this solution, but maybe you can explore it and give us a feedback!

Steph

NEW il y a 4 mois

atom atom

Is there no way to configure the type of files it's supposed to examine?

Otherwise, for Atom, I found something that might interest you: the platform.io plugin that works with the framework of the same name (PlatformIO), which replaces the Arduino IDE. I checked, the SAMD21G18A card is supported (it is the same card as the Gamebuino META).

Take a look at this post, you'll probably find what you need.

I haven't tried this solution, but maybe you can explore it and give us a feedback!

atom

il y a 4 mois

I have tried Platform.io plugin on in Atom but I haven't manage to make it work.Gamebuino Library is available in it to download but there is no Gamebuino Platform or Board.I have searched samd21g18a and I got these options
1)SparkFun SAMD21 Mini Breakout
2)Atmel SAMD21-XPRO
3)SparkFun SAMD21 Dev Breakout

but they only produce project folders with .cpp file not .ino with Arduino.h library included.But it shows this error right away

arm-none-eabi-g++: error: SAMD21": No such file or directory

About the linter for .ino files I have found in Platform that Smart Code Linter is disabled by default for Arduino files (*.ino and .pde) because they are not valid C/C++ based source files there is a procedure to do in order to get it working here:
https://docs.platformio.org/en/latest/ide/atom.html?highlight=.INO#smart-code-linter

I have installed VSCodium(VSCode) and Arduino plugin code linting works but when I verify a project I am getting this error:

/home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp: In member function 'void Gamebuino_Meta::Gamebuino::begin()':
/home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp:162:2: error: static assertion failed: Your sketch name is less than 4 chars long, please define FOLDER_NAME!
  static_assert(sizeof SKETCH_NAME - 1 >= 4 + 4, "Your sketch name is less than 4 chars long, please define FOLDER_NAME!");
  ^
Using library Gamebuino_META at version 1.3.1 in folder: /home/user/Arduino/libraries/Gamebuino_META
Using library SPI at version 1.0 in folder: /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.0/libraries/SPI
exit status 1
[Error] Exit with code=1

I opened Gamebuino-Meta.cpp and commented the lines about the folder name but another error shows now.Can you help me to get working  VSCodium?

/tmp/arduino_build_65098/sketch/src/main.cpp.o: In function setup': /tmp/arduino_build_65098/sketch/src/main.cpp:6: multiple definition ofsetup'
/tmp/arduino_build_65098/sketch/app.ino.cpp.o:/home/user/Documents/PlatformIO/Projects/DELETE/app.ino:4: first defined here
/tmp/arduino_build_65098/sketch/src/main.cpp.o: In function loop': /tmp/arduino_build_65098/sketch/src/main.cpp:11: multiple definition ofloop'
/tmp/arduino_build_65098/sketch/app.ino.cpp.o:/home/user/Documents/PlatformIO/Projects/DELETE/app.ino:9: first defined here
collect2: error: ld returned 1 exit status
Using library Gamebuino_META at version 1.3.1 in folder: /home/user/Arduino/libraries/Gamebuino_META
Using library SPI at version 1.0 in folder: /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.0/libraries/SPI
exit status 1

Sorunome

NEW il y a 4 mois

Hey there! Soru actually wrote arduino-upload ^^ Anyhow, it is meant to be used in combination with language-arduino

atom

NEW il y a 4 mois

Steph Steph

I have tried Platform.io plugin on in Atom but I haven't manage to make it work.Gamebuino Library is available in it to download but there is no Gamebuino Platform or Board.I have searched samd21g18a and I got these options
1)SparkFun SAMD21 Mini Breakout
2)Atmel SAMD21-XPRO
3)SparkFun SAMD21 Dev Breakout

but they only produce project folders with .cpp file not .ino with Arduino.h library included.But it shows this error right away

arm-none-eabi-g++: error: SAMD21": No such file or directory

About the linter for .ino files I have found in Platform that Smart Code Linter is disabled by default for Arduino files (*.ino and .pde) because they are not valid C/C++ based source files there is a procedure to do in order to get it working here:
https://docs.platformio.org/en/latest/ide/atom.html?highlight=.INO#smart-code-linter

I have installed VSCodium(VSCode) and Arduino plugin code linting works but when I verify a project I am getting this error:

/home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp: In member function 'void Gamebuino_Meta::Gamebuino::begin()':
/home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp:162:2: error: static assertion failed: Your sketch name is less than 4 chars long, please define FOLDER_NAME!
  static_assert(sizeof SKETCH_NAME - 1 >= 4 + 4, "Your sketch name is less than 4 chars long, please define FOLDER_NAME!");
  ^
Using library Gamebuino_META at version 1.3.1 in folder: /home/user/Arduino/libraries/Gamebuino_META
Using library SPI at version 1.0 in folder: /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.0/libraries/SPI
exit status 1
[Error] Exit with code=1

I opened Gamebuino-Meta.cpp and commented the lines about the folder name but another error shows now.Can you help me to get working  VSCodium?

/tmp/arduino_build_65098/sketch/src/main.cpp.o: In function setup': /tmp/arduino_build_65098/sketch/src/main.cpp:6: multiple definition ofsetup'
/tmp/arduino_build_65098/sketch/app.ino.cpp.o:/home/user/Documents/PlatformIO/Projects/DELETE/app.ino:4: first defined here
/tmp/arduino_build_65098/sketch/src/main.cpp.o: In function loop': /tmp/arduino_build_65098/sketch/src/main.cpp:11: multiple definition ofloop'
/tmp/arduino_build_65098/sketch/app.ino.cpp.o:/home/user/Documents/PlatformIO/Projects/DELETE/app.ino:9: first defined here
collect2: error: ld returned 1 exit status
Using library Gamebuino_META at version 1.3.1 in folder: /home/user/Arduino/libraries/Gamebuino_META
Using library SPI at version 1.0 in folder: /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.0/libraries/SPI
exit status 1

Steph

il y a 4 mois

Thank you for your feedback!

Actually, you shouldn't change the official lib ;-)

The error is clearly indicated:

Your sketch name is less than 4 chars long, please define FOLDER_NAME!

You can create a config-gamebuino.h file at the root of your project with this line:

#define FOLDER_NAME "your_sketch_name"

Now, to properly set up Visual Studio Code, I encourage you to read the bfx tutorial carefully.

Steph

NEW il y a 4 mois

atom atom

Thank you for your feedback!

Actually, you shouldn't change the official lib ;-)

The error is clearly indicated:

Your sketch name is less than 4 chars long, please define FOLDER_NAME!

You can create a config-gamebuino.h file at the root of your project with this line:

#define FOLDER_NAME "your_sketch_name"

Now, to properly set up Visual Studio Code, I encourage you to read the bfx tutorial carefully.

atom

il y a 4 mois

Thank you for you help, I turned out to be a problem having multiple plugins enabled after I removed them it got fixed. I made clean install of VSCodium and Arduino and C/C++ plugin.This is my cpp properties json file 

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/home/user/Arduino/libraries/Gamebuino_META/src/**",
                "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/**",
                            ],
            "forcedInclude": [
                "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h"
            ],
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

Autocomplete works , g++ checks for errors but it shows this error now

cannot open source file "sam.h" (dependency of "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h")

atom

NEW il y a 4 mois

Steph Steph

Thank you for you help, I turned out to be a problem having multiple plugins enabled after I removed them it got fixed. I made clean install of VSCodium and Arduino and C/C++ plugin.This is my cpp properties json file 

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/home/user/Arduino/libraries/Gamebuino_META/src/**",
                "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/**",
                            ],
            "forcedInclude": [
                "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h"
            ],
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "/usr/bin/g++",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

Autocomplete works , g++ checks for errors but it shows this error now

cannot open source file "sam.h" (dependency of "/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h")

Steph

il y a 4 mois

Try the following command.... you should normally get the same result:

$ find ~/.arduino15 -iname 'sam.h'
/home/user/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam.h

Otherwise, you must check the installation of SAMD cards as explained in the user manual:

Steph

NEW il y a 4 mois

atom atom

Try the following command.... you should normally get the same result:

$ find ~/.arduino15 -iname 'sam.h'
/home/user/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam.h

Otherwise, you must check the installation of SAMD cards as explained in the user manual:

atom

il y a 4 mois

I have 2 outputs
/home/user/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel/Device/ATMEL/sam.h
/home/user/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam.h

I installed it correctly as the manual shows

atom

NEW il y a 4 mois

Steph Steph

I have 2 outputs
/home/user/.arduino15/packages/arduino/tools/CMSIS/4.0.0-atmel/Device/ATMEL/sam.h
/home/user/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL/sam.h

I installed it correctly as the manual shows

Steph

il y a 4 mois

Fix you c_cpp_properties.json with the following: (scroll down to see the entire file)

{
    "env": {
        "LINUX_PACKAGES_PATH": "${env:HOME}/.arduino15/packages",
        "LINUX_SKETCHBOOK_PATH": "${env:HOME}/Arduino"
    },

    "configurations": [
        {
            "name": "Linux",
            "intelliSenseMode": "gcc-x64",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "compilerPath": "\"${env:LINUX_PACKAGES_PATH}/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++\" -mcpu=cortex-m0plus   -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -D__SKETCH_NAME__ -DF_CPU=48000000L -DARDUINO=10809 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -save-temps=obj -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON -DUSB_MANUFACTURER -DUSB_PRODUCT",

            "includePath": [
                "${workspaceFolder}",
                "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS/4.5.0/CMSIS/Include",
                "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/variants/gamebuino_meta",
                "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/libraries/SPI"
            ],

            "browse": {
                "path": [
                    "${workspaceFolder}",
                    "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS/4.5.0/CMSIS/Include",
                    "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/variants/gamebuino_meta",
                    "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/libraries/SPI"
                ],
                "limitSymbolsToIncludedHeaders": true
            },
            "forcedInclude": [
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h",
                "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src/Gamebuino-Meta.h"
            ]
        }
    ],

    "version": 4
}

Steph

NEW il y a 4 mois

atom atom

Fix you c_cpp_properties.json with the following: (scroll down to see the entire file)

{
    "env": {
        "LINUX_PACKAGES_PATH": "${env:HOME}/.arduino15/packages",
        "LINUX_SKETCHBOOK_PATH": "${env:HOME}/Arduino"
    },

    "configurations": [
        {
            "name": "Linux",
            "intelliSenseMode": "gcc-x64",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "compilerPath": "\"${env:LINUX_PACKAGES_PATH}/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++\" -mcpu=cortex-m0plus   -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -D__SKETCH_NAME__ -DF_CPU=48000000L -DARDUINO=10809 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -save-temps=obj -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON -DUSB_MANUFACTURER -DUSB_PRODUCT",

            "includePath": [
                "${workspaceFolder}",
                "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS/4.5.0/CMSIS/Include",
                "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/variants/gamebuino_meta",
                "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src",
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/libraries/SPI"
            ],

            "browse": {
                "path": [
                    "${workspaceFolder}",
                    "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS/4.5.0/CMSIS/Include",
                    "${env:LINUX_PACKAGES_PATH}/arduino/tools/CMSIS-Atmel/1.1.0/CMSIS/Device/ATMEL",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/variants/gamebuino_meta",
                    "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src",
                    "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/libraries/SPI"
                ],
                "limitSymbolsToIncludedHeaders": true
            },
            "forcedInclude": [
                "${env:LINUX_PACKAGES_PATH}/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h",
                "${env:LINUX_SKETCHBOOK_PATH}/libraries/Gamebuino_META/src/Gamebuino-Meta.h"
            ]
        }
    ],

    "version": 4
}

atom

NEW il y a 4 mois

Its working now :) . I did gave permissions to the serial port and I can upload to Gamebuino directly. I need to press upload 2 times in order to make Gamebuino to "usb mode" when it has the USB logo on screen the first time and then to upload it.This the output when I am verifying the Hello World Example  I have some warnings but it works

home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp:939:6: warning: unused parameter 'outputPin' [-Wunused-parameter]
 void tone(uint32_t outputPin, uint32_t frequency, uint32_t duration) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/Gamebuino-Meta.cpp:948:6: warning: unused parameter 'outputPin' [-Wunused-parameter]
 void noTone(uint32_t outputPin) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Display-ST7735/Display-ST7735.cpp:101:6: warning: unused parameter 'dma' [-Wunused-parameter]
 void dma_tft_suspend_callback(Adafruit_ZeroDMA *dma) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Display-ST7735/Display-ST7735.cpp:109:6: warning: unused parameter 'dma' [-Wunused-parameter]
 void dma_tft_done_callback(Adafruit_ZeroDMA *dma) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Display-ST7735/Display-ST7735.cpp:411:6: warning: unused parameter 'img' [-Wunused-parameter]
 void Display_ST7735::drawBufferedLine(int16_t x, int16_t y, uint16_t *buffer, uint16_t w, Image& img) {
      ^
In file included from /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h:36:0,
                 from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/../../config/config.h:72,
                 from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.h:4,
                 from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:34:
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp: In member function 'virtual size_t Gamebuino_Meta::Graphics::write(uint8_t)':
/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/avr/pgmspace.h:104:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
                                                            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:151:42: note: in expansion of macro 'pgm_read_dword'
  #define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr))
                                          ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:966:38: note: in expansion of macro 'pgm_read_pointer'
     GFXglyph *glyph = &(((GFXglyph *)pgm_read_pointer(&gfxFont->glyph))[c2]);
                                      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp: In member function 'virtual void Gamebuino_Meta::Graphics::drawChar(int16_t, int16_t, unsigned char, uint8_t)':
/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/avr/pgmspace.h:104:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
                                                            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:151:42: note: in expansion of macro 'pgm_read_dword'
  #define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr))
                                          ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1039:37: note: in expansion of macro 'pgm_read_pointer'
   GFXglyph *glyph  = &(((GFXglyph *)pgm_read_pointer(&gfxFont->glyph))[c]);
                                     ^
/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/avr/pgmspace.h:104:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
                                                            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:151:42: note: in expansion of macro 'pgm_read_dword'
  #define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr))
                                          ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1040:33: note: in expansion of macro 'pgm_read_pointer'
   uint8_t  *bitmap = (uint8_t *)pgm_read_pointer(&gfxFont->bitmap);
                                 ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp: In member function 'void Gamebuino_Meta::Graphics::getTextBounds(char*, int16_t, int16_t, int16_t*, int16_t*, uint16_t*, uint16_t*)':
/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/avr/pgmspace.h:104:60: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 #define pgm_read_dword(addr) (*(const unsigned long *)(addr))
                                                            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:151:42: note: in expansion of macro 'pgm_read_dword'
  #define pgm_read_pointer(addr) ((void *)pgm_read_dword(addr))
                                          ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1302:30: note: in expansion of macro 'pgm_read_pointer'
       glyph = &(((GFXglyph *)pgm_read_pointer(&gfxFont->glyph))[c]);
                              ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp: At global scope:
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1400:6: warning: unused parameter 'i' [-Wunused-parameter]
 void Graphics::invertDisplay(bool i) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp: In member function 'virtual void Gamebuino_Meta::Graphics::drawChar(int16_t, int16_t, unsigned char, uint8_t)':
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1078:5: warning: 'bits' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if(bits & 0x80) {
     ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1048:18: warning: 'yo16' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int16_t  xo16, yo16;
                  ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Graphics/Graphics.cpp:1048:12: warning: 'xo16' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int16_t  xo16, yo16;
            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/MetaMode/MetaMode.cpp: In member function 'void Gamebuino_Meta::MetaMode::updateAnimations()':
/home/user/Arduino/libraries/Gamebuino_META/src/utility/MetaMode/MetaMode.cpp:179:50: warning: comparison is always false due to limited range of data type [-Wtype-limits]
    if (animPercentage >= 100 || animPercentage < 0) continue;
                                                  ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/SdFat/src/SpiDriver/SdSpiGamebuino.cpp:40:6: warning: unused parameter 'dma' [-Wunused-parameter]
 void dma_callback_rx(Gamebuino_Meta::Adafruit_ZeroDMA *dma) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/SdFat/src/SpiDriver/SdSpiGamebuino.cpp:43:6: warning: unused parameter 'dma' [-Wunused-parameter]
 void dma_callback_tx(Gamebuino_Meta::Adafruit_ZeroDMA *dma) {
      ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound_FX.cpp: In member function 'void Gamebuino_Meta::Sound_Handler_FX::init()':
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound_FX.cpp:35:15: warning: overflow in implicit constant conversion [-Woverflow]
  _pitch_scale = 1 << FPP;
               ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp:63:29: warning: missing initializer for member 'Gamebuino_Meta::FX_Channel::index' [-Wmissing-field-initializers]
 FX_Channel fx_channel = { 0 };
                             ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp:63:29: warning: missing initializer for member 'Gamebuino_Meta::FX_Channel::handler' [-Wmissing-field-initializers]
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp:63:29: warning: missing initializer for member 'Gamebuino_Meta::FX_Channel::size' [-Wmissing-field-initializers]
In file included from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/../../config/config.h:72:0,
                 from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.h:27,
                 from /home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp:24:
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp: In member function 'void Gamebuino_Meta::Sound::setVolume(uint8_t)':
/home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/cores/arduino/Arduino.h:103:44: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
                                            ^
/home/user/Arduino/libraries/Gamebuino_META/src/utility/Sound/Sound.cpp:360:17: note: in expansion of macro 'constrain'
  globalVolume = constrain(volume, 0, 8);
                 ^
Bootloader file specified but missing: /home/user/.arduino15/packages/gamebuino/hardware/samd/1.2.1/bootloaders/gamebuino_meta/samd21_sam_ba.bin
Sketch uses 53812 bytes (21%) of program storage space. Maximum is 245760 bytes.

 Thank you very much!!!

Steph

il y a 4 mois

It's weird... Can you tell me the exact path of your serial port on Linux, please?

Steph

NEW il y a 4 mois

atom atom

It's weird... Can you tell me the exact path of your serial port on Linux, please?

atom

il y a 4 mois

/dev/tty/ACM0

atom

NEW il y a 4 mois

Steph Steph

/dev/tty/ACM0

Steph

il y a 4 mois

Okay, so you did this, I guess:

sudo usermod -a -G dialout <username>

But... I wonder if there is not a better port? Like /dev/ttyUSB0.

On macOS we have an optimized port, like: /dev/cu.usbmodem141101.
The number may be different depending on the port to which META is connected.

On Visual Studio Code, you can check the available serial ports using the Command Palette [Shift][Ctrl][P]:

Steph

NEW il y a 4 mois

atom atom

Okay, so you did this, I guess:

sudo usermod -a -G dialout <username>

But... I wonder if there is not a better port? Like /dev/ttyUSB0.

On macOS we have an optimized port, like: /dev/cu.usbmodem141101.
The number may be different depending on the port to which META is connected.

On Visual Studio Code, you can check the available serial ports using the Command Palette [Shift][Ctrl][P]:

atom

il y a 3 mois

Yes that command.I restarted my pc and started it again and it worked for the first time .On the second time I  tried to upload it an error pops up from Ubuntu and then I need to Upload it again  in order to show up on the device.I pressed report problem but it didn't show any report after that also Arduino/VSCodium showed this error  .

An error occurred while uploading the sketch
No device found on ttyACM0

The Ubuntu error is related to the issue


atom

NEW il y a 3 mois

Steph Steph

Yes that command.I restarted my pc and started it again and it worked for the first time .On the second time I  tried to upload it an error pops up from Ubuntu and then I need to Upload it again  in order to show up on the device.I pressed report problem but it didn't show any report after that also Arduino/VSCodium showed this error  .

An error occurred while uploading the sketch
No device found on ttyACM0

The Ubuntu error is related to the issue


Steph

il y a 3 mois

If you plug your console into another USB port, the device will necessarily change on your Linux. So, to solve the problem, leave your console connected to the same USB port.

Obviously, you're not using the right serial port....

To get the list of serial ports detected by Visual Studio Code, can you perform the procedure I indicated to you with the Command Palette, please? And show me what you get?