diff options
| author | JF <jf@codingfield.com> | 2020-01-22 18:45:53 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-01-22 18:45:53 (GMT) |
| commit | aa3e5c0c6f6f7bb9df02ae5d333dc6c4a6d2e744 (patch) | |
| tree | 58bc64ef06dd6f0199aff19321713cff4b43dd0f /src/main.cpp | |
| parent | b4bd41cd562f89bcd320ac0985e9b33c766babe1 (diff) | |
[WIP] Use IRQ in SPI driver to improve performances
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 062a36e..14be5ca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(); |
