mirror of
https://github.com/espressif/esp-idf.git
synced 2024-09-20 00:36:01 -04:00
Merge branch 'contrib/github_pr_9213' into 'master'
Fix out of range in mcpwm example (GitHub PR) Closes IDFGH-7666 See merge request espressif/esp-idf!18678
This commit is contained in:
commit
b0fa5c7c2d
@ -243,7 +243,7 @@ void app_main(void)
|
||||
while (1) {
|
||||
// The rotation direction is controlled by inverting the hall sensor value
|
||||
hall_sensor_value = bldc_get_hall_sensor_value(false);
|
||||
if (hall_sensor_value >= 1 && hall_sensor_value <= sizeof(s_hall_actions) / sizeof(s_hall_actions[0])) {
|
||||
if (hall_sensor_value >= 1 && hall_sensor_value < sizeof(s_hall_actions) / sizeof(s_hall_actions[0])) {
|
||||
s_hall_actions[hall_sensor_value]();
|
||||
} else {
|
||||
ESP_LOGE(TAG, "invalid bldc phase, wrong hall sensor value:%d", hall_sensor_value);
|
||||
|
Loading…
Reference in New Issue
Block a user