No bugs detected
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_kalman_correct_accel();
#endif
#endif
ao_kalman_correct_accel();
#endif
#endif
- ao_height = from_fix(ao_k_height);
- ao_speed = from_fix(ao_k_speed);
- ao_accel = from_fix(ao_k_accel);
+ ao_height = (ao_v_t) from_fix(ao_k_height);
+ ao_speed = (ao_v_t) from_fix(ao_k_speed);
+ ao_accel = (ao_v_t) from_fix(ao_k_accel);
if (ao_height > ao_max_height)
ao_max_height = ao_height;
#if HAS_BARO
if (ao_height > ao_max_height)
ao_max_height = ao_height;
#if HAS_BARO
-ao_report_number(int16_t n)
+ao_report_number(ao_v_t n)
{
uint8_t digits[10];
uint8_t ndigits, i;
{
uint8_t digits[10];
uint8_t ndigits, i;
- digits[ndigits++] = n % 10;
+ digits[ndigits++] = (uint8_t) (n % 10);
uint8_t
ao_report_igniter(void)
{
uint8_t
ao_report_igniter(void)
{
- return (ao_report_igniter_ready(ao_igniter_drogue) |
- (ao_report_igniter_ready(ao_igniter_main) << 1));
+ return (uint8_t) (ao_report_igniter_ready(ao_igniter_drogue) |
+ (ao_report_igniter_ready(ao_igniter_main) << 1));
agl = 0;
ndigits = 0;
do {
agl = 0;
ndigits = 0;
do {
- digits[ndigits++] = agl % 10;
+ digits[ndigits++] = (uint8_t) agl % 10;
agl /= 10;
} while (agl);
agl /= 10;
} while (agl);
#include "ao.h"
AO_ROMCONFIG_SYMBOL uint16_t ao_romconfig_version = AO_ROMCONFIG_VERSION;
#include "ao.h"
AO_ROMCONFIG_SYMBOL uint16_t ao_romconfig_version = AO_ROMCONFIG_VERSION;
-AO_ROMCONFIG_SYMBOL uint16_t ao_romconfig_check = ~AO_ROMCONFIG_VERSION;
+AO_ROMCONFIG_SYMBOL uint16_t ao_romconfig_check = (uint16_t) ~AO_ROMCONFIG_VERSION;
AO_ROMCONFIG_SYMBOL uint16_t ao_serial_number = 0;
#if HAS_RADIO
AO_ROMCONFIG_SYMBOL uint32_t ao_radio_cal = AO_RADIO_CAL_DEFAULT;
AO_ROMCONFIG_SYMBOL uint16_t ao_serial_number = 0;
#if HAS_RADIO
AO_ROMCONFIG_SYMBOL uint32_t ao_radio_cal = AO_RADIO_CAL_DEFAULT;
ao_sample_set_one_orient(void)
{
ao_sample_orients[ao_sample_orient_pos] = ao_sample_orient;
ao_sample_set_one_orient(void)
{
ao_sample_orients[ao_sample_orient_pos] = ao_sample_orient;
- ao_sample_orient_pos = (ao_sample_orient_pos + 1) % AO_NUM_ORIENT;
+ ao_sample_orient_pos = (uint8_t) ((ao_sample_orient_pos + 1) % AO_NUM_ORIENT);
float rotz;
rotz = ao_rotation.z * ao_rotation.z - ao_rotation.y * ao_rotation.y - ao_rotation.x * ao_rotation.x + ao_rotation.r * ao_rotation.r;
float rotz;
rotz = ao_rotation.z * ao_rotation.z - ao_rotation.y * ao_rotation.y - ao_rotation.x * ao_rotation.x + ao_rotation.r * ao_rotation.r;
- ao_sample_orient = acosf(rotz) * (float) (180.0/M_PI);
+ ao_sample_orient = (angle_t) (acosf(rotz) * (float) (180.0/M_PI));
ao_sample_preflight_set(void)
{
#if HAS_ACCEL
ao_sample_preflight_set(void)
{
#if HAS_ACCEL
- ao_ground_accel = ao_sample_accel_sum >> 9;
+ ao_ground_accel = (accel_t) (ao_sample_accel_sum >> 9);
ao_sample_accel_sum = 0;
#endif
#if HAS_BARO
ao_sample_accel_sum = 0;
#endif
#if HAS_BARO
ao_sample_pres_sum = 0;
#endif
#if HAS_IMU
ao_sample_pres_sum = 0;
#endif
#if HAS_IMU
- ao_ground_accel_along = ao_sample_accel_along_sum >> 9;
- ao_ground_accel_across = ao_sample_accel_across_sum >> 9;
- ao_ground_accel_through = ao_sample_accel_through_sum >> 9;
+ ao_ground_accel_along = (accel_t) (ao_sample_accel_along_sum >> 9);
+ ao_ground_accel_across = (accel_t) (ao_sample_accel_across_sum >> 9);
+ ao_ground_accel_through = (accel_t) (ao_sample_accel_through_sum >> 9);
ao_sample_accel_along_sum = 0;
ao_sample_accel_across_sum = 0;
ao_sample_accel_through_sum = 0;
#endif
#if HAS_MOTOR_PRESSURE
ao_sample_accel_along_sum = 0;
ao_sample_accel_across_sum = 0;
ao_sample_accel_through_sum = 0;
#endif
#if HAS_MOTOR_PRESSURE
- ao_ground_motor_pressure = ao_sample_motor_pressure_sum >> 9;
+ ao_ground_motor_pressure = (motor_pressure_t) (ao_sample_motor_pressure_sum >> 9);
ao_sample_motor_pressure_sum = 0;
#endif
#if HAS_GYRO
ao_sample_motor_pressure_sum = 0;
#endif
#if HAS_GYRO
static void
ao_send_packet(void)
{
static void
ao_send_packet(void)
{
return;
ao_send[i] = b;
}
return;
ao_send[i] = b;
}
- ao_radio_send(ao_send, count);
+ ao_radio_send(ao_send, (uint8_t) count);
}
static const struct ao_cmds ao_send_packet_cmds[] = {
}
static const struct ao_cmds ao_send_packet_cmds[] = {