Closed
Description
Using the Ardiuno IDE 2 with latest SimpleFOC library and latest Arduino-Pico core, with my RP2040 based board, and the current sense code fails to compile with the following error:
c:\Users\...\Documents\Arduino\libraries\Simple_FOC\src\current_sense\hardware_specific\rp2040\rp2040_mcu.cpp:19:44: error: 'ADC_CS_START_ONCE_BITS' was not declared in this scope
19 | alignas(32) const uint32_t trigger_value = ADC_CS_START_ONCE_BITS; // start once
Several more errors follow, but they are a consequence of this error and go away when it is resolved.
It looks like rp2040_mcu.cpp in the current_sense folder is missing this include statement:
#include "hardware/adc.h"
When I add this line everything compiles and runs successfully. There is even a drastic improvement in the smoothness of motor compared to last release of SimpleFOC, thanks so much for the development effort! 😄