diff options
| author | JF <jf@codingfield.com> | 2020-01-22 20:08:53 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-01-22 20:08:53 (GMT) |
| commit | eb7a1b3ac9cbacb74afb7fcd1d40c51a18c90060 (patch) | |
| tree | a0f886e007080ce0f3867dd7deb87fecd22ab212 /src/DisplayApp/DisplayApp.cpp | |
| parent | aa3e5c0c6f6f7bb9df02ae5d333dc6c4a6d2e744 (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/DisplayApp/DisplayApp.cpp')
| -rw-r--r-- | src/DisplayApp/DisplayApp.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp index 29c75fa..c1561cc 100644 --- a/src/DisplayApp/DisplayApp.cpp +++ b/src/DisplayApp/DisplayApp.cpp @@ -65,7 +65,28 @@ void DisplayApp::InitHw() { touchPanel.Init(); } +uint32_t acc = 0; +uint32_t count = 0; +bool toggle = true; void DisplayApp::Refresh() { + + uint32_t before = nrf_rtc_counter_get(portNRF_RTC_REG); + if(toggle) { + gfx->FillRectangle(0,0,240,240,0x0000); + } else { + gfx->FillRectangle(0,0,240,240,0xffff); + } + uint32_t after = nrf_rtc_counter_get(portNRF_RTC_REG); + + acc += (after - before); + if((count % 10) == 0) { + NRF_LOG_INFO("DRAW : %d ms", (uint32_t)(acc/10)); + acc = 0; + } + count++; + toggle = !toggle; + +#if 0 TickType_t queueTimeout; switch (state) { case States::Idle: @@ -116,6 +137,7 @@ void DisplayApp::Refresh() { break; } } +#endif } void DisplayApp::RunningState() { |
