diff options
author | Keith Packard <keithp@keithp.com> | 2011-10-07 09:53:09 -0600 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-07 09:54:32 -0600 |
commit | 258b75498916183ed250d3abb3282fe3d843e7a1 (patch) | |
tree | d71a42f289a8fb31caf40c51746a1c42d8886ba3 /src/core/ao_config.c | |
parent | 128bbfa150f88c09f7adde2434b7bf0b5a9ed556 (diff) |
altos: Write xdata versions of memory functions1.0.9.1
These are significantly smaller than the general pointer versions from
libc on the cc1111.
Signed-off-by: Keith Packard <keithp@keithp.com>
Conflicts:
src/Makefile.proto
src/cc1111/ao_adc.c
src/cc1111/ao_packet_master.c
src/core/ao.h
Fix up the new makefiles
Diffstat (limited to 'src/core/ao_config.c')
-rw-r--r-- | src/core/ao_config.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/core/ao_config.c b/src/core/ao_config.c index a653bed2..08cc79b1 100644 --- a/src/core/ao_config.c +++ b/src/core/ao_config.c @@ -78,8 +78,8 @@ _ao_config_get(void) /* Version 0 stuff */ ao_config.main_deploy = AO_CONFIG_DEFAULT_MAIN_DEPLOY; ao_config.radio_channel = AO_CONFIG_DEFAULT_RADIO_CHANNEL; - memset(&ao_config.callsign, '\0', sizeof (ao_config.callsign)); - memcpy(&ao_config.callsign, AO_CONFIG_DEFAULT_CALLSIGN, + ao_xmemset(&ao_config.callsign, '\0', sizeof (ao_config.callsign)); + ao_xmemcpy(&ao_config.callsign, AO_CONFIG_DEFAULT_CALLSIGN, sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1); ao_config_dirty = 1; } @@ -148,7 +148,7 @@ ao_config_callsign_set(void) __reentrant uint8_t c; static __xdata char callsign[AO_MAX_CALLSIGN + 1]; - memset(callsign, '\0', sizeof callsign); + ao_xmemset(callsign, '\0', sizeof callsign); ao_cmd_white(); c = 0; while (ao_cmd_lex_c != '\n') { @@ -161,7 +161,7 @@ ao_config_callsign_set(void) __reentrant if (ao_cmd_status != ao_cmd_success) return; _ao_config_edit_start(); - memcpy(&ao_config.callsign, &callsign, + ao_xmemcpy(&ao_config.callsign, &callsign, AO_MAX_CALLSIGN + 1); _ao_config_edit_finish(); } @@ -535,7 +535,8 @@ ao_config_help(void) __reentrant for (cmd = 0; ao_config_vars[cmd].str != NULL; cmd++) printf("%-20s %s\n", ao_config_vars[cmd].str, - ao_config_vars[cmd].str+1+strlen(ao_config_vars[cmd].str)); + ao_config_vars[cmd].str+1+ + strlen(ao_config_vars[cmd].str)); } static void |