-
Notifications
You must be signed in to change notification settings - Fork 616
Description
Commit 0b7839f broke pwm control on my machine and B-G431B. The offending change appears to be:
before: src/drivers/hardware_specific/generic_mcu.cpp
#elif defined(_STM32_DEF_) // or stm32
/// do nothing
#else
int _configure6PWM(...){ return -1; }
#endif
After: rc/drivers/hardware_specific/generic_mcu.cpp
__attribute__((weak)) int _configure6PWM(...) {return -1;}
Although this implementation is declared weak, the linker still selects this implementation for the final executable, instead of the correct one in src/drivers/hardware_specific/stm32_mcu.cpp. This problem occurs with all weakly defined implementations in this file. Simply emptying the file returns everything to working order.
I'm observing very strange behavior when debugging this issue. Sometimes, removing just one of the functions from generic_mcu.cpp fixes the issue. Sometimes, it doesn't. This suggests we're dealing with nondeterministic compiler behavior...