mimxrt: Improve ticks and sleep functions using GPT.

SysTick cannot wake the CPU from WFI/WFE so a hardware timer is needed to
keep track of ticks/delay (similar to the nrf port).

Fixes issue #7234.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2021-05-16 13:27:54 +10:00
parent 452fa3f8d4
commit 7408ca1d78
7 changed files with 189 additions and 27 deletions

View File

@@ -53,9 +53,6 @@ void board_init(void) {
// Enable IOCON clock
CLOCK_EnableClock(kCLOCK_Iomuxc);
// 1ms tick timer
SysTick_Config(SystemCoreClock / 1000);
// ------------- USB0 ------------- //
// Clock
@@ -85,10 +82,6 @@ void board_init(void) {
// CLOCK_EnableUsbhs1Clock(kCLOCK_Usb480M, 480000000U);
}
void SysTick_Handler(void) {
systick_ms++;
}
void USB_OTG1_IRQHandler(void) {
tud_int_handler(0);
tud_task();