summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/sharp96test/Makefile.inc2
-rw-r--r--src/app/sharp96test/main.cc2
-rw-r--r--src/app/transactiontest/main.cc11
-rw-r--r--src/app/transactiontest/util.S9
4 files changed, 11 insertions, 13 deletions
diff --git a/src/app/sharp96test/Makefile.inc b/src/app/sharp96test/Makefile.inc
index 37bb857..a63136a 100644
--- a/src/app/sharp96test/Makefile.inc
+++ b/src/app/sharp96test/Makefile.inc
@@ -1,5 +1,5 @@
ifdef app
override loop = 1
- override arch_drivers += spi_b
+ override arch_drivers += spi
override drivers += sharp96
endif
diff --git a/src/app/sharp96test/main.cc b/src/app/sharp96test/main.cc
index bbf9258..38a8a3d 100644
--- a/src/app/sharp96test/main.cc
+++ b/src/app/sharp96test/main.cc
@@ -1,7 +1,7 @@
#include "arch.h"
#include "driver/gpio.h"
#include "driver/stdout.h"
-#include "driver/spi_b.h"
+#include "driver/spi.h"
#include "driver/sharp96.h"
unsigned char const lynx[12 * 96] = {
diff --git a/src/app/transactiontest/main.cc b/src/app/transactiontest/main.cc
index 1ca7f67..12d995f 100644
--- a/src/app/transactiontest/main.cc
+++ b/src/app/transactiontest/main.cc
@@ -2,13 +2,9 @@
#include "driver/gpio.h"
#include "driver/stdout.h"
#include "driver/uptime.h"
-#include "driver/spi_b.h"
+#include "driver/spi.h"
#include "driver/sharp96.h"
-#ifndef TIMER_CYCLES
-#error makeflag timer_cycles=1 required
-#endif
-
unsigned char const lynx[12 * 96] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -117,6 +113,9 @@ extern "C" {
uint16_t i = 0;
class Transaction {
+ /**
+ * Transactions objects must not be nested.
+ */
public:
inline Transaction() { asm_save_all(); }
inline ~Transaction() {}
@@ -126,7 +125,6 @@ class Transaction {
void loop(void)
{
- gpio.led_toggle(1);
{
Transaction tx;
kout << dec << i << endl;
@@ -153,7 +151,6 @@ int main(void)
sharp96.setup();
sharp96.powerOn();
- gpio.led_on(0);
gpio.input(GPIO::p4_5, 1);
asm_load_all();
diff --git a/src/app/transactiontest/util.S b/src/app/transactiontest/util.S
index 1a12736..ea298b6 100644
--- a/src/app/transactiontest/util.S
+++ b/src/app/transactiontest/util.S
@@ -6,6 +6,7 @@
#define SRAM_SIZE 4096
; SRAM and stack pointer backup space
+; two backup areas allow for consistency in case of a power loss during backup
sp_backup1:
.space 2
sram_backup1:
@@ -20,7 +21,8 @@ sram_backup2:
backup_cookie:
.space 2
-; save entire SRAM and CPU register state to persistent FRAM
+; save entire SRAM and CPU register state to persistent FRAM.
+; Must be called with interrupts disabled
asm_save_all:
; r4 to r11 are callee saved -> push them to the stack.
@@ -65,9 +67,8 @@ save_sram_word:
; load entire SRAM and CPU register state from persistent FRAM,
; if it contains valid backup data. Execution will resume at the
-; last place where asm_save_all() was called is if nothing in between
-; had happened. Does not take possible the state of hardware peripherals
-; into account.
+; last place where asm_save_all() was called as if nothing in between
+; had happened. Does not take the state of hardware peripherals into account.
asm_load_all:
; check if we have backup data