Commit 5f0b229f authored by François Revol's avatar François Revol

Use TMR3 instead of TMR5 for interrupts from epicardium

Any reason to use TMR5 except preventing the use of PWM on the IR LED?

TMR4 is used for the LCD backlight it seems.
parent f41a61d1
Pipeline #4676 failed with stages
in 3 minutes and 2 seconds
...@@ -74,7 +74,7 @@ void __core1_init(void) ...@@ -74,7 +74,7 @@ void __core1_init(void)
/* /*
* Clear any pending API interrupts. * Clear any pending API interrupts.
*/ */
TMR_IntClear(MXC_TMR5); TMR_IntClear(MXC_TMR3);
/* /*
* Disable the SysTick * Disable the SysTick
...@@ -181,8 +181,8 @@ void __core1_init(void) ...@@ -181,8 +181,8 @@ void __core1_init(void)
/* /*
* Clear any pending API interrupts. * Clear any pending API interrupts.
*/ */
TMR_IntClear(MXC_TMR5); TMR_IntClear(MXC_TMR3);
NVIC_ClearPendingIRQ(TMR5_IRQn); NVIC_ClearPendingIRQ(TMR3_IRQn);
/* /*
* Jump to payload's reset handler * Jump to payload's reset handler
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
void __dispatch_isr(api_int_id_t); void __dispatch_isr(api_int_id_t);
/* Timer Interrupt used for control char notification */ /* Timer Interrupt used for control char notification */
void TMR5_IRQHandler(void) void TMR3_IRQHandler(void)
{ {
TMR_IntClear(MXC_TMR5); TMR_IntClear(MXC_TMR3);
__dispatch_isr(API_CALL_MEM->int_id); __dispatch_isr(API_CALL_MEM->int_id);
API_CALL_MEM->int_id = (-1); API_CALL_MEM->int_id = (-1);
} }
......
...@@ -18,5 +18,5 @@ void api_interrupt_trigger(api_int_id_t id) ...@@ -18,5 +18,5 @@ void api_interrupt_trigger(api_int_id_t id)
assert(API_CALL_MEM->int_id == (api_int_id_t)(-1)); assert(API_CALL_MEM->int_id == (api_int_id_t)(-1));
API_CALL_MEM->int_id = id; API_CALL_MEM->int_id = id;
TMR_TO_Start(MXC_TMR5, 1, 0); TMR_TO_Start(MXC_TMR3, 1, 0);
} }
...@@ -207,8 +207,8 @@ DefaultHandler: ...@@ -207,8 +207,8 @@ DefaultHandler:
def_irq_handler TMR0_IRQHandler def_irq_handler TMR0_IRQHandler
def_irq_handler TMR1_IRQHandler def_irq_handler TMR1_IRQHandler
def_irq_handler TMR2_IRQHandler def_irq_handler TMR2_IRQHandler
def_irq_handler TMR3_IRQHandler
def_irq_handler TMR4_IRQHandler def_irq_handler TMR4_IRQHandler
def_irq_handler TMR5_IRQHandler
def_irq_handler RSV11_IRQHandler def_irq_handler RSV11_IRQHandler
def_irq_handler RSV12_IRQHandler def_irq_handler RSV12_IRQHandler
def_irq_handler I2C0_IRQHandler def_irq_handler I2C0_IRQHandler
......
...@@ -77,7 +77,7 @@ __weak void SystemInit() ...@@ -77,7 +77,7 @@ __weak void SystemInit()
SystemCoreClockUpdate(); SystemCoreClockUpdate();
// Enable API interrupt. // Enable API interrupt.
NVIC_EnableIRQ(TMR5_IRQn); NVIC_EnableIRQ(TMR3_IRQn);
} }
// newlib syscall to allow printf to work. // newlib syscall to allow printf to work.
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
/* Initialize everything for MicroPython */ /* Initialize everything for MicroPython */
void pycardium_hal_init(void) void pycardium_hal_init(void)
{ {
/* TMR5 is used for interrupts from Epicardium */ /* TMR3 is used for interrupts from Epicardium */
NVIC_EnableIRQ(TMR5_IRQn); NVIC_EnableIRQ(TMR3_IRQn);
/* /*
* Enable UART RX Interrupt so Pycardium can sleep until * Enable UART RX Interrupt so Pycardium can sleep until
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment