Error compiling JoyC_&_RoverC/Master/Master.ino

  • I try to compile the code from
    under Arduino: 1.8.19 (Windows 10), Board: "M5Stick-C-Plus, Default, 1500000, None"
    But i get an error:

    RoverC:88:23: error: 'I2C_ERROR_NO_BEGIN' was not declared in this scope
     uint8_t IIC_ReState = I2C_ERROR_NO_BEGIN;
    C:\Users\toro\Documents\Arduino\RoverC\RoverC.ino:88:23: note: suggested alternative: 'ESP_ERR_NO_MEM'
     uint8_t IIC_ReState = I2C_ERROR_NO_BEGIN;

    The answer is in the error, following the suggestion fixes the error.

    Now, besides that it works i have no idea if the replacement is correct logically. The Const-Names suggest yes, but there might be more to it...
    If the replacement is universally ok, should a github pull request be made?

    There is an error/warning thrown that i had overlooked.
    So, just doing the replacement seems like not enough...

    warning: unsigned conversion from 'int' to 'uint8_t' {aka 'unsigned char'} changes value from '257' to '1' [-Woverflow]
     #define ESP_ERR_NO_MEM              0x101   /*!< Out of memory */
    ...\Arduino\RoverC\RoverC.ino:88:23: note: in expansion of macro 'ESP_ERR_NO_MEM'
     uint8_t IIC_ReState = ESP_ERR_NO_MEM;

  • @sirtet Change "I2C_ERROR_NO_BEGIN" to "ESP_OK". The git for M5StickC-Plus has already been fixed with this. The fix also works for the M5StickC code.