Skip to content

Commit

Permalink
Fix stupid uint32_t underflow error
Browse files Browse the repository at this point in the history
For some reason, I must've replaced the original bit of code with my own 0 IQ version, which checks if "i" (an UNSIGNED integer) is negative.
  • Loading branch information
nicohmje committed Mar 7, 2024
1 parent ff1d22f commit e2c94e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CoVAPSy_STM32/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef* htim)
break;
somme_intervalles_us += tableau_intervalles_us[i];

i--;
if (i < 0) i = 15;
i = (i - 1)%16;

nb_intervalles++;

}while ((somme_intervalles_us<10000) && (nb_intervalles < 16));
Expand Down

0 comments on commit e2c94e2

Please sign in to comment.