Skip to content

Commit

Permalink
Must clear done bit on restart of RDOS timer.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdos314 committed Dec 22, 2024
1 parent d5021e0 commit e14ae58
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bld/clib/rdos/c/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static void UpdateTimers( )
if( timer->Active.CompletedBitmap[i] & mask ) {
if( ( timer->Req.DoneBitmap[i] & mask ) == 0 ) {
timer->Req.DoneBitmap[i] |= mask;
FCurrIndex = 32 * i + bit - 4;
FCurrEntry = &timer->Req.EntryArr[FCurrIndex];
FCurrIndex = 32 * i + bit;
FCurrEntry = &timer->Req.EntryArr[FCurrIndex - 4];
( *FCurrEntry->callback )( FCurrEntry->param );
FCurrEntry = 0;
FCurrIndex = 0;
Expand Down Expand Up @@ -198,9 +198,18 @@ static int StopTimer( int index )

static int RestartCurrTimer( long long timeout )
{
int i;
int bit;
int mask;

if( FCurrEntry == 0 )
return( 0 );

i = FCurrIndex / 32;
bit = FCurrIndex % 32;
mask = 1 << bit;
timer->Req.DoneBitmap[i] &= ~mask;

FCurrEntry->timeout = timeout;
__locked_set_bit( timer->Req.ReqBitmap, FCurrIndex );
return( 1 );
Expand Down

0 comments on commit e14ae58

Please sign in to comment.