aboutsummaryrefslogtreecommitdiff
path: root/Source/System.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/System.c')
-rw-r--r--Source/System.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/System.c b/Source/System.c
index 864e2fc..2a3513a 100644
--- a/Source/System.c
+++ b/Source/System.c
@@ -67,6 +67,11 @@ static unsigned char sine_counter;
* *******************************************************************/
void SystemInit(void)
{
+ enum
+ {
+ RCNT2_100US_TICK_COUNTER = 0xA560
+ };
+
//Reset global timer
global_timer = 0;
//Reset 1 second timer
@@ -118,7 +123,9 @@ void SystemInit(void)
SystemSetStackPattern();
- SetRCntHandler(&ISR_RootCounter2, 2, 0xA560);
+ // Configure root counter 2 so that ISR_RootCounter2
+ // is executed every 100 us.
+ SetRCntHandler(&ISR_RootCounter2, 2, RCNT2_100US_TICK_COUNTER);
SystemEnableRCnt2Interrupt();
}