summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ao.h6
-rw-r--r--src/core/ao_cmd.c4
-rw-r--r--src/core/ao_config.c11
-rw-r--r--src/core/ao_ee_fake.c2
-rw-r--r--src/core/ao_gps_report.c4
-rw-r--r--src/core/ao_host.h4
-rw-r--r--src/core/ao_monitor.c4
-rw-r--r--src/core/ao_telemetry.c10
8 files changed, 28 insertions, 17 deletions
diff --git a/src/core/ao.h b/src/core/ao.h
index 04610fea..c0474729 100644
--- a/src/core/ao.h
+++ b/src/core/ao.h
@@ -1817,4 +1817,10 @@ ao_log_single(void);
#define AO_TELEPYRO_NUM_ADC 9
+#ifndef ao_xmemcpy
+#define ao_xmemcpy(d,s,c) memcpy(d,s,c)
+#define ao_xmemset(d,v,c) memset(d,v,c)
+#define ao_xmemcmp(d,s,c) memcmp(d,s,c)
+#endif
+
#endif /* _AO_H_ */
diff --git a/src/core/ao_cmd.c b/src/core/ao_cmd.c
index 2b64b8ca..0c902f6b 100644
--- a/src/core/ao_cmd.c
+++ b/src/core/ao_cmd.c
@@ -265,8 +265,8 @@ help(void)
cs = ao_cmds[cmds];
for (cmd = 0; cs[cmd].func; cmd++)
printf("%-45s %s\n",
- cs[cmd].help,
- cs[cmd].help+1+strlen(cs[cmd].help));
+ cs[cmd].help,
+ cs[cmd].help+1+strlen(cs[cmd].help));
}
}
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
diff --git a/src/core/ao_ee_fake.c b/src/core/ao_ee_fake.c
index b0c1d61e..7fcfcab0 100644
--- a/src/core/ao_ee_fake.c
+++ b/src/core/ao_ee_fake.c
@@ -32,6 +32,6 @@ ao_ee_write_config(uint8_t *buf, uint16_t len) __reentrant
uint8_t
ao_ee_read_config(uint8_t *buf, uint16_t len) __reentrant
{
- memset(buf, '\0', len);
+ ao_xmemset(buf, '\0', len);
return 1;
}
diff --git a/src/core/ao_gps_report.c b/src/core/ao_gps_report.c
index e57f8744..c52ef621 100644
--- a/src/core/ao_gps_report.c
+++ b/src/core/ao_gps_report.c
@@ -27,7 +27,7 @@ ao_gps_report(void)
for (;;) {
ao_sleep(&ao_gps_data);
ao_mutex_get(&ao_gps_mutex);
- memcpy(&gps_data, &ao_gps_data, sizeof (ao_gps_data));
+ ao_xmemcpy(&gps_data, &ao_gps_data, sizeof (ao_gps_data));
ao_mutex_put(&ao_gps_mutex);
if (!(gps_data.flags & AO_GPS_VALID))
@@ -72,7 +72,7 @@ ao_gps_tracking_report(void)
ao_sleep(&ao_gps_tracking_data);
ao_mutex_get(&ao_gps_mutex);
gps_log.tick = ao_gps_tick;
- memcpy(&gps_tracking_data, &ao_gps_tracking_data, sizeof (ao_gps_tracking_data));
+ ao_xmemcpy(&gps_tracking_data, &ao_gps_tracking_data, sizeof (ao_gps_tracking_data));
ao_mutex_put(&ao_gps_mutex);
if (!(n = gps_tracking_data.channels))
diff --git a/src/core/ao_host.h b/src/core/ao_host.h
index 65c25fe5..f2b2f0c9 100644
--- a/src/core/ao_host.h
+++ b/src/core/ao_host.h
@@ -125,3 +125,7 @@ struct ao_config {
#define ao_config_get()
struct ao_config ao_config = { 250, 16000 };
+
+#define ao_xmemcpy(d,s,c) memcpy(d,s,c)
+#define ao_xmemset(d,v,c) memset(d,v,c)
+#define ao_xmemcmp(d,s,c) memcmp(d,s,c)
diff --git a/src/core/ao_monitor.c b/src/core/ao_monitor.c
index 56d7604d..1a8bb52a 100644
--- a/src/core/ao_monitor.c
+++ b/src/core/ao_monitor.c
@@ -94,7 +94,7 @@ ao_monitor_put(void)
/* Typical RSSI offset for 38.4kBaud at 433 MHz is 74 */
rssi = (int16_t) (recv_orig.rssi >> 1) - 74;
- memcpy(callsign, recv_orig.telemetry_orig.callsign, AO_MAX_CALLSIGN);
+ ao_xmemcpy(callsign, recv_orig.telemetry_orig.callsign, AO_MAX_CALLSIGN);
if (state > ao_flight_invalid)
state = ao_flight_invalid;
if (recv_orig.status & PKT_APPEND_STATUS_1_CRC_OK) {
@@ -171,7 +171,7 @@ ao_monitor_put(void)
/* Typical RSSI offset for 38.4kBaud at 433 MHz is 74 */
rssi = (int16_t) (recv_tiny.rssi >> 1) - 74;
- memcpy(callsign, recv_tiny.telemetry_tiny.callsign, AO_MAX_CALLSIGN);
+ ao_xmemcpy(callsign, recv_tiny.telemetry_tiny.callsign, AO_MAX_CALLSIGN);
if (state > ao_flight_invalid)
state = ao_flight_invalid;
if (recv_tiny.status & PKT_APPEND_STATUS_1_CRC_OK) {
diff --git a/src/core/ao_telemetry.c b/src/core/ao_telemetry.c
index 26e4e2a0..95e53917 100644
--- a/src/core/ao_telemetry.c
+++ b/src/core/ao_telemetry.c
@@ -131,10 +131,10 @@ ao_send_configuration(void)
telemetry.configuration.apogee_delay = ao_config.apogee_delay;
telemetry.configuration.main_deploy = ao_config.main_deploy;
telemetry.configuration.flight_log_max = ao_config.flight_log_max >> 10;
- memcpy (telemetry.configuration.callsign,
+ ao_xmemcpy (telemetry.configuration.callsign,
ao_config.callsign,
AO_MAX_CALLSIGN);
- memcpy (telemetry.configuration.version,
+ ao_xmemcpy (telemetry.configuration.version,
ao_version,
AO_MAX_VERSION);
ao_radio_send(&telemetry, sizeof (telemetry));
@@ -150,7 +150,7 @@ ao_send_location(void)
{
telemetry.generic.type = AO_TELEMETRY_LOCATION;
ao_mutex_get(&ao_gps_mutex);
- memcpy(&telemetry.location.flags,
+ ao_xmemcpy(&telemetry.location.flags,
&ao_gps_data.flags,
26);
ao_mutex_put(&ao_gps_mutex);
@@ -167,7 +167,7 @@ ao_send_satellite(void)
telemetry.generic.type = AO_TELEMETRY_SATELLITE;
ao_mutex_get(&ao_gps_mutex);
telemetry.satellite.channels = ao_gps_tracking_data.channels;
- memcpy(&telemetry.satellite.sats,
+ ao_xmemcpy(&telemetry.satellite.sats,
&ao_gps_tracking_data.sats,
AO_MAX_GPS_TRACKING * sizeof (struct ao_telemetry_satellite_info));
ao_mutex_put(&ao_gps_mutex);
@@ -187,7 +187,7 @@ ao_send_companion(void)
telemetry.companion.update_period = ao_companion_setup.update_period;
telemetry.companion.channels = ao_companion_setup.channels;
ao_mutex_get(&ao_companion_mutex);
- memcpy(&telemetry.companion.companion_data,
+ ao_xmemcpy(&telemetry.companion.companion_data,
ao_companion_data,
ao_companion_setup.channels * 2);
ao_mutex_put(&ao_companion_mutex);