[WIP] Use IRQ in SPI driver to improve performances
This commit is contained in:
14
src/main.cpp
14
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();
|
||||
|
Reference in New Issue
Block a user