projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Send serial/flight to companion board
[fw/altos]
/
src
/
ao_flash.c
diff --git
a/src/ao_flash.c
b/src/ao_flash.c
index d323926fe209d310c2e27f3382259709664e9752..bb40f6f708b95515d165da8e131031639474593b 100644
(file)
--- a/
src/ao_flash.c
+++ b/
src/ao_flash.c
@@
-19,16
+19,16
@@
#include "at45db161d.h"
/* Total bytes of available storage */
#include "at45db161d.h"
/* Total bytes of available storage */
-__
x
data uint32_t ao_storage_total;
+__
p
data uint32_t ao_storage_total;
/* Block size - device is erased in these units. At least 256 bytes */
/* Block size - device is erased in these units. At least 256 bytes */
-__
x
data uint32_t ao_storage_block;
+__
p
data uint32_t ao_storage_block;
/* Byte offset of config block. Will be ao_storage_block bytes long */
/* Byte offset of config block. Will be ao_storage_block bytes long */
-__
x
data uint32_t ao_storage_config;
+__
p
data uint32_t ao_storage_config;
/* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */
/* Storage unit size - device reads and writes must be within blocks of this size. Usually 256 bytes. */
-__
x
data uint16_t ao_storage_unit;
+__
p
data uint16_t ao_storage_unit;
#define FLASH_CS P1_1
#define FLASH_CS_INDEX 1
#define FLASH_CS P1_1
#define FLASH_CS_INDEX 1
@@
-43,19
+43,9
@@
__xdata uint8_t ao_flash_mutex;
_asm nop _endasm; \
} while(0)
_asm nop _endasm; \
} while(0)
-void ao_flash_cs_low(void)
-{
- ao_flash_delay();
- FLASH_CS = 0;
- ao_flash_delay();
-}
+#define ao_flash_cs_low() ao_spi_get_bit(FLASH_CS)
-void ao_flash_cs_high(void)
-{
- ao_flash_delay();
- FLASH_CS = 1;
- ao_flash_delay();
-}
+#define ao_flash_cs_high() ao_spi_put_bit(FLASH_CS)
struct ao_flash_instruction {
uint8_t instruction;
struct ao_flash_instruction {
uint8_t instruction;