From b132eefc5f63412bb4a98a4bb72b9055e40d5d42 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 11 Nov 2011 22:30:17 -0800 Subject: altos: Make ao_xmem funcs require __xdata void * instead of casting Having an explicit cast in the ao_xmem wrapper macros caused the compiler to generate garbage values for pdata addresses, making the upper byte 0x00 instead of the required 0xf0. Removing the casts from the ao_xmem macros exposed this problem, so a new PDATA_TO_XDATA macros was added, along with a CODE_TO_XDATA macro which serve to cast pointers, with suitable address modifications, so that things work again. Signed-off-by: Keith Packard --- src/core/ao_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/ao_config.c') diff --git a/src/core/ao_config.c b/src/core/ao_config.c index 08cc79b1..f0a576ee 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -79,7 +79,7 @@ _ao_config_get(void) ao_config.main_deploy = AO_CONFIG_DEFAULT_MAIN_DEPLOY; ao_config.radio_channel = AO_CONFIG_DEFAULT_RADIO_CHANNEL; ao_xmemset(&ao_config.callsign, '\0', sizeof (ao_config.callsign)); - ao_xmemcpy(&ao_config.callsign, AO_CONFIG_DEFAULT_CALLSIGN, + ao_xmemcpy(&ao_config.callsign, CODE_TO_XDATA(AO_CONFIG_DEFAULT_CALLSIGN), sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1); ao_config_dirty = 1; } -- cgit v1.2.3