projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Make ao_xmem funcs require __xdata void * instead of casting
[fw/altos]
/
src
/
cc1111
/
ao_arch.h
diff --git
a/src/cc1111/ao_arch.h
b/src/cc1111/ao_arch.h
index f0f0daae4260b80f0bad7efa18127595f0f880b3..001165fafd9bae0b592a4be9f1da975ce8f6e9eb 100644
(file)
--- a/
src/cc1111/ao_arch.h
+++ b/
src/cc1111/ao_arch.h
@@
-27,6
+27,12
@@
/* Convert a __data pointer into an __xdata pointer */
#define DATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xff00))
/* Convert a __data pointer into an __xdata pointer */
#define DATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xff00))
+/* Code and xdata use the same address space */
+#define CODE_TO_XDATA(a) ((__xdata void *) ((uint16_t) (a)))
+
+/* Pdata lives at the start of xdata */
+#define PDATA_TO_XDATA(a) ((void __xdata *) ((uint8_t) (a) | 0xf000))
+
/* Stack runs from above the allocated __data space to 0xfe, which avoids
* writing to 0xff as that triggers the stack overflow indicator
*/
/* Stack runs from above the allocated __data space to 0xfe, which avoids
* writing to 0xff as that triggers the stack overflow indicator
*/
@@
-228,18
+234,18
@@
ao_button_get(void) __critical;
/* ao_string.c */
void
/* ao_string.c */
void
-_ao_xmemcpy(__xdata
uint8_t *dst, __xdata uint8_t
*src, uint8_t count);
+_ao_xmemcpy(__xdata
void *dst, __xdata void
*src, uint8_t count);
-#define ao_xmemcpy(d,s,c) _ao_xmemcpy(
(__xdata uint8_t *) (d), (__xdata uint8_t *) (s), (c)
)
+#define ao_xmemcpy(d,s,c) _ao_xmemcpy(
d,s,c
)
void
void
-_ao_xmemset(__xdata
uint8_t
*dst, uint8_t value, uint8_t count);
+_ao_xmemset(__xdata
void
*dst, uint8_t value, uint8_t count);
-#define ao_xmemset(d,v,c) _ao_xmemset(
(__xdata uint8_t *) (d), (v), (c)
)
+#define ao_xmemset(d,v,c) _ao_xmemset(
d,v,c
)
int8_t
int8_t
-_ao_xmemcmp(__xdata
uint8_t *a, __xdata uint8_t
*b, uint8_t count);
+_ao_xmemcmp(__xdata
void *a, __xdata void
*b, uint8_t count);
-#define ao_xmemcmp(d,s,c) _ao_xmemcmp((
__xdata uint8_t *) (d), (__xdata uint8_t *)
(s), (c))
+#define ao_xmemcmp(d,s,c) _ao_xmemcmp((
d),
(s), (c))
#endif /* _AO_ARCH_H_ */
#endif /* _AO_ARCH_H_ */