diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/ao.h | 6 | ||||
| -rw-r--r-- | src/core/ao_config.c | 2 | ||||
| -rw-r--r-- | src/core/ao_host.h | 4 | ||||
| -rw-r--r-- | src/core/ao_telemetry.c | 8 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/core/ao.h b/src/core/ao.h index 9b8d3270..cbe2f8dc 100644 --- a/src/core/ao.h +++ b/src/core/ao.h @@ -32,6 +32,12 @@ #ifndef DATA_TO_XDATA #define DATA_TO_XDATA(a) (a) #endif +#ifndef PDATA_TO_XDATA +#define PDATA_TO_XDATA(a) (a) +#endif +#ifndef CODE_TO_XDATA +#define CODE_TO_XDATA(a) (a) +#endif /* An AltOS task */ struct ao_task { 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; } diff --git a/src/core/ao_host.h b/src/core/ao_host.h index f2b2f0c9..6eb752c9 100644 --- a/src/core/ao_host.h +++ b/src/core/ao_host.h @@ -46,6 +46,10 @@ struct ao_adc { #define __code #define __reentrant +#define DATA_TO_XDATA(a) (a) +#define PDATA_TO_XDATA(a) (a) +#define CODE_TO_XDATA(a) (a) + enum ao_flight_state { ao_flight_startup = 0, ao_flight_idle = 1, diff --git a/src/core/ao_telemetry.c b/src/core/ao_telemetry.c index e66598d1..c68f1589 100644 --- a/src/core/ao_telemetry.c +++ b/src/core/ao_telemetry.c @@ -132,11 +132,11 @@ ao_send_configuration(void) telemetry.configuration.main_deploy = ao_config.main_deploy; telemetry.configuration.flight_log_max = ao_config.flight_log_max >> 10; ao_xmemcpy (telemetry.configuration.callsign, - ao_config.callsign, - AO_MAX_CALLSIGN); + ao_config.callsign, + AO_MAX_CALLSIGN); ao_xmemcpy (telemetry.configuration.version, - ao_version, - AO_MAX_VERSION); + CODE_TO_XDATA(ao_version), + AO_MAX_VERSION); ao_radio_send(&telemetry, sizeof (telemetry)); ao_telemetry_config_cur = ao_telemetry_config_max; } |
