Giter Site home page Giter Site logo

Comments (3)

Love4yzp avatar Love4yzp commented on July 19, 2024

from sensecap_indicator_esp32.

ugurakas avatar ugurakas commented on July 19, 2024
 ^~~~~~~~~~~~~~~~~~~        

C:/Users/ugura/esp/esp-idf-v5.0/components/iot_button/button_adc.c:181:5: note: in expansion of macro 'ESP_LOGV'
181 |
ESP_LOGV(TAG, "Raw: %d\tVoltage: %dmV", adc_reading, voltage);
|
^~~~~~~~
C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:265:27
error: format '%d' expects argument of type 'int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
265 | #define LOG_COLOR(COLOR) "\033[0;" COLOR "m"
|
^~~~~~~~~
C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:270:27
note: in expansion of macro 'LOG_COLOR'
270 | #define LOG_COLOR_I LOG_COLOR(LOG_COLOR_GREEN)
|
^~~~~~~~~
C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:282:37
note: in expansion of macro 'LOG_COLOR_I'
282 | #define LOG_FORMAT(letter, format) LOG_COLOR_ ## letter #letter " (%" PRIu32 ") %s: " format LOG_RESET_COLOR "\n"
|

    ^~~~~~~~~~      

C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:414:86
note: in expansion of macro 'LOG_FORMAT'
414 | else

{ esp_log_write(ESP_LOG_INFO,       tag, LOG_FORMAT(I, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \       
  |                 
        
        
        
        
        
     ^~~~~~~~~~     

C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:432:41
note: in expansion of macro 'ESP_LOG_LEVEL'
432 | if ( LOG_LOCAL_LEVEL >= level )
ESP_LOG_LEVEL(level, tag, format, ##VA_ARGS);
|

^~~~~~~~~~~~~
C:/Users/ugura/esp/esp-idf-v5.0/components/log/include/esp_log.h:344:38
note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
344 | #define ESP_LOGV( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_VERBOSE, tag, format, ##VA_ARGS)
|

     ^~~~~~~~~~~~~~~~~~~        

C:/Users/ugura/esp/esp-idf-v5.0/components/iot_button/button_adc.c:181:5: note: in expansion of macro 'ESP_LOGV'
181 |
ESP_LOGV(TAG, "Raw: %d\tVoltage: %dmV", adc_reading, voltage);
|
^~~~~~~~
cc1.exe: some warnings being treated as errors
[16/....obj
ninja: build stopped: subcommand failed.

  • The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1.

from sensecap_indicator_esp32.

Love4yzp avatar Love4yzp commented on July 19, 2024

@ugurakas The error is occurring because there is a mismatch between the format specifier and data type at line 181 in button_adc.c.

Specifically:

  • ESP_LOGV macro expands to ESP_LOG_LEVEL
  • ESP_LOG_LEVEL uses LOG_FORMAT macro
  • LOG_FORMAT expects matching types between format specifiers and additional arguments
  • At line 181, format %d expects int but adc_reading is uint32_t

This causes the format mismatch error. The compiler is treating this as an error due to the flags set.

To fix, you should:

  • Use %u format specifier for uint32_t type of adc_reading
  • Or cast adc_reading to int before passing to ESP_LOGV

from sensecap_indicator_esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.