summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-01-22 21:08:53 +0100
committerJF <jf@codingfield.com>2020-01-22 21:08:53 +0100
commiteb7a1b3ac9cbacb74afb7fcd1d40c51a18c90060 (patch)
treea0f886e007080ce0f3867dd7deb87fecd22ab212 /src/main.cpp
parentaa3e5c0c6f6f7bb9df02ae5d333dc6c4a6d2e744 (diff)
[WIP] Max SPI speed reached (119ms for a full refresh. Theo max : 240*240*16 = 115.2ms) using IRQ and DMA.
Code needs some cleaning before integration.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 14be5ca2..284113c1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -162,7 +162,12 @@ 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();
+ spiInstance->irqEnd();
+ }
+
+ if(((NRF_SPIM0->INTENSET & (1<<19)) != 0) && NRF_SPIM0->EVENTS_STARTED == 1) {
+ NRF_SPIM0->EVENTS_STARTED = 0;
+ spiInstance->irqStarted();
}