Skip to content

Commit

Permalink
Fixing a particular time shifiting from scheduller
Browse files Browse the repository at this point in the history
  • Loading branch information
solariun committed May 25, 2020
1 parent 605a70e commit 1d62845
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CorePartition.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ static uint32_t GetTicks()
static void SleepTicks(const uint32_t nSleepValue)
{
uint32_t nSleepTicks = nSleepValue;
uint32_t nCTime=1;

while (nSleepTicks--) nCTime=GetTicks ();
while (nSleepTicks-- && nCTime) nCTime=GetTicks ();
}

bool CorePartition_Start (size_t nThreadPartitions)
Expand Down
6 changes: 5 additions & 1 deletion PCExample/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ static void StackOverflowHandler ()
int main(int argc, const char * argv[])
{

CorePartition_Start(4);
if (CorePartition_Start(4) == false)
{
printf ("Error starting up Thread.");
return (1);
}

CorePartition_SetCurrentTimeInterface(getMsTicks);
CorePartition_SetSleepTimeInterface (sleepMSTicks);
Expand Down

0 comments on commit 1d62845

Please sign in to comment.