PPI: Fix UBSAN warning
The result of shifting an int 31 bits left is in principle undefined. So let's cast 1 to a uint32_t before shifting. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
d17c9d749c
commit
24f5d3d11e
|
@ -732,7 +732,7 @@ void nrf_ppi_event(ppi_event_types_t event){
|
|||
for ( int ch_nbr = __builtin_ffs(ch_mask) - 1;
|
||||
( ch_mask != 0 ) && ( ch_nbr < NUMBER_PPI_CHANNELS ) ;
|
||||
ch_nbr++ ) {
|
||||
if ( ch_mask & ( 1 << ch_nbr ) ){
|
||||
if ( ch_mask & ( (uint32_t) 1 << ch_nbr ) ){
|
||||
ch_mask &= ~( (uint64_t) 1 << ch_nbr );
|
||||
if ( ppi_ch_tasks[ch_nbr].tep_f != NULL ){
|
||||
nrf_ppi_enqueue_task(ppi_ch_tasks[ch_nbr].tep_f);
|
||||
|
|
Loading…
Reference in New Issue