[WIP] Use IRQ in SPI driver to improve performances

This commit is contained in:
JF
2020-01-22 19:45:53 +01:00
parent b4bd41cd56
commit aa3e5c0c6f
5 changed files with 90 additions and 54 deletions

View File

@@ -158,6 +158,20 @@ void OnNewTime(current_time_char_t* currentTime) {
dayOfWeek, hour, minute, second, nrf_rtc_counter_get(portNRF_RTC_REG));
}
extern Pinetime::Drivers::SpiMaster* spiInstance;
void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler(void) {
if(((NRF_SPIM0->INTENSET & (1<<6)) != 0) && NRF_SPIM0->EVENTS_END == 1) {
NRF_SPIM0->EVENTS_END = 0;
spiInstance->irq();
}
if(((NRF_SPIM0->INTENSET & (1<<1)) != 0) && NRF_SPIM0->EVENTS_STOPPED == 1) {
NRF_SPIM0->EVENTS_STOPPED = 0;
}
return;
}
int main(void) {
displayApp.reset(new Pinetime::Applications::DisplayApp(batteryController, bleController, dateTimeController));
logger.Init();