mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
samd/samd_isr: Extend systick_ms to 64 bit.
By adding a 32 bit overflow counter. This allows it to be used for the time functions.
This commit is contained in:
@@ -32,6 +32,7 @@ extern uint32_t _estack, _sidata, _sdata, _edata, _sbss, _ebss;
|
||||
|
||||
const ISR isr_vector[];
|
||||
uint32_t systick_ms;
|
||||
volatile uint32_t systick_ms_upper;
|
||||
|
||||
void Reset_Handler(void) __attribute__((naked));
|
||||
void Reset_Handler(void) {
|
||||
@@ -81,7 +82,11 @@ void Default_Handler(void) {
|
||||
}
|
||||
|
||||
void SysTick_Handler(void) {
|
||||
systick_ms += 1;
|
||||
uint32_t next_tick = systick_ms + 1;
|
||||
systick_ms = next_tick;
|
||||
if (systick_ms == 0) {
|
||||
systick_ms_upper += 1;
|
||||
}
|
||||
}
|
||||
|
||||
const ISR isr_vector[] __attribute__((section(".isr_vector"))) = {
|
||||
|
||||
Reference in New Issue
Block a user