summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-02-18 09:52:41 -0500
committerJoey Castillo <joeycastillo@utexas.edu>2022-02-18 09:52:41 -0500
commit75c98a6c97cf9d680d70e2d608490f2d3c5da228 (patch)
tree92c3f1906135781319baa749f8c9e9e199772b66 /apps
parent8e1c7f0631e3513bc5411b3f6bdf7f4012fe69d1 (diff)
downloadSensor-Watch-75c98a6c97cf9d680d70e2d608490f2d3c5da228.tar.gz
Sensor-Watch-75c98a6c97cf9d680d70e2d608490f2d3c5da228.tar.bz2
Sensor-Watch-75c98a6c97cf9d680d70e2d608490f2d3c5da228.zip
tweaks to SPI test
Diffstat (limited to 'apps')
-rw-r--r--apps/spi-test/app.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/spi-test/app.c b/apps/spi-test/app.c
index c1818200..fab49c31 100644
--- a/apps/spi-test/app.c
+++ b/apps/spi-test/app.c
@@ -38,16 +38,16 @@ static bool wait_for_flash_ready(void) {
do {
ok = spi_flash_read_command(CMD_READ_STATUS, read_status_response, 1);
} while ((read_status_response[0] & 0x3) != 0);
- delay_ms(10);
+ delay_ms(1); // why do i need this?
watch_set_pin_level(A3, true);
return ok;
}
static void print_records_at_page(uint16_t page) {
- if (page < 477) return;
+ if (page < 650) return;
acceleromter_training_record_t records[32];
- static uint32_t timestamp;
- static uint16_t temperature;
+ static uint32_t timestamp = 0;
+ static uint16_t temperature = 0;
wait_for_flash_ready();
spi_flash_read_data(page * 256, (void *)records, 256);
for(int i = 0; i < 32; i++) {
@@ -71,7 +71,6 @@ static void print_records_at_page(uint16_t page) {
}
static void print_records() {
- printf("printing records\n");
uint8_t buf[256];
for(int16_t i = 0; i < 4; i++) {
wait_for_flash_ready();
@@ -252,7 +251,6 @@ bool app_loop(void) {
printf("Partial write\n");
write_buffer_to_page((uint8_t *)records, next_available_page);
wait_for_flash_ready();
- delay_ms(10);
}
}