In pico-sdk/src/rp2_common/hardware_pwm/include/hardware/pwm.h the int16_t Should be `static inline uint16_t pwm_get_counter(uint slice_num) {`