diff --git a/TaskScheduler/TaskScheduler.c b/TaskScheduler/TaskScheduler.c index 9698296..acce0d6 100644 --- a/TaskScheduler/TaskScheduler.c +++ b/TaskScheduler/TaskScheduler.c @@ -76,10 +76,10 @@ void InitializeTaskScheduler(uint32_t timerBase, uint32_t sysCtlTimerPeriph, uin //Configure the timer to be a periodic 100us timer TimerConfigure(timerBase, TIMER_CFG_PERIODIC); - TimerLoadSet(timerBase, TIMER_A, sysClkFreq * TASK_SCHEDULER_TIMER_PERIOD / 1000000); + TimerLoadSet(timerBase, TIMER_A, sysClkFreq * (TASK_SCHEDULER_TIMER_PERIOD / 1000000.0f)); //Configure the ISR - TimerIntRegister(timerBase, TIMER_BOTH, TaskSchedulerTimer_ISR); + TimerIntRegister(timerBase, TIMER_A, TaskSchedulerTimer_ISR); IntEnable(timerIntBase); TimerIntEnable(timerBase, TIMER_TIMA_TIMEOUT); diff --git a/TaskScheduler/TaskScheduler.h b/TaskScheduler/TaskScheduler.h index 189db52..b519e02 100644 --- a/TaskScheduler/TaskScheduler.h +++ b/TaskScheduler/TaskScheduler.h @@ -5,8 +5,8 @@ #include //For the most accurate timer, choose a frequency that is an integer -#define TASK_SCHEDULER_TIMER_PERIOD 100 //us -#define TASK_SCHEDULER_TICKS_IN_ONE_SECOND 1/TASK_SCHEDULER_TIMER_PERIOD * 1000000 +#define TASK_SCHEDULER_TIMER_PERIOD 100.0f //us +#define TASK_SCHEDULER_TICKS_IN_ONE_SECOND 1.0f/TASK_SCHEDULER_TIMER_PERIOD * 1000000.0f struct Task_tag; typedef struct Task_tag Task;