projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos]
/
src
/
ao_ee.c
diff --git
a/src/ao_ee.c
b/src/ao_ee.c
index e3b41103f56558e55fe1ca5b9f49f27c3384b726..a2fe8dc19a974384706b4cc5b0b7efcd1fdb90ed 100644
(file)
--- a/
src/ao_ee.c
+++ b/
src/ao_ee.c
@@
-23,16
+23,16
@@
#define EE_DEVICE_SIZE ((uint32_t) 128 * (uint32_t) 1024)
/* Total bytes of available storage */
#define EE_DEVICE_SIZE ((uint32_t) 128 * (uint32_t) 1024)
/* 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;
/*
* Using SPI on USART 0, with P1_2 as the chip select
/*
* Using SPI on USART 0, with P1_2 as the chip select
@@
-49,19
+49,9
@@
static __xdata uint8_t ao_ee_mutex;
_asm nop _endasm; \
} while(0)
_asm nop _endasm; \
} while(0)
-static void ao_ee_cs_low(void)
-{
- ao_ee_delay();
- EE_CS = 0;
- ao_ee_delay();
-}
+#define ao_ee_cs_low() ao_spi_get_bit(EE_CS)
-static void ao_ee_cs_high(void)
-{
- ao_ee_delay();
- EE_CS = 1;
- ao_ee_delay();
-}
+#define ao_ee_cs_high() ao_spi_put_bit(EE_CS)
struct ao_ee_instruction {
uint8_t instruction;
struct ao_ee_instruction {
uint8_t instruction;