From 07587222a38992651827c0ded4e6a8f18b951cca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jun 2013 13:34:09 +1000 Subject: [PATCH] Rover: tweaks to new scheduler code --- APMrover2/APMrover2.pde | 5 +++-- APMrover2/sensors.pde | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/APMrover2/APMrover2.pde b/APMrover2/APMrover2.pde index 9da9f448cd..4437278a83 100644 --- a/APMrover2/APMrover2.pde +++ b/APMrover2/APMrover2.pde @@ -595,10 +595,10 @@ void loop() // We want this to execute at 50Hz, but synchronised with the gyro/accel uint16_t num_samples = ins.num_samples_available(); if (num_samples >= 1) { - delta_ms_fast_loop = millis() - fast_loopTimer; + delta_ms_fast_loop = timer - fast_loopTimer; load = (float)(fast_loopTimeStamp - fast_loopTimer)/delta_ms_fast_loop; G_Dt = (float)delta_ms_fast_loop / 1000.f; - fast_loopTimer = millis(); + fast_loopTimer = timer; mainLoop_count++; @@ -741,6 +741,7 @@ static void one_second_loop(void) // cope with changes to aux functions update_aux_servo_function(&g.rc_2, &g.rc_4, &g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8); + enable_aux_servos(); #if MOUNT == ENABLED camera_mount.update_mount_type(); diff --git a/APMrover2/sensors.pde b/APMrover2/sensors.pde index b37821677b..34bc1896c8 100644 --- a/APMrover2/sensors.pde +++ b/APMrover2/sensors.pde @@ -36,7 +36,7 @@ static void read_battery(void) batt_curr_pin->set_pin(g.battery_curr_pin); current_amps1 = CURRENT_AMPS(batt_curr_pin); // .0002778 is 1/3600 (conversion to hours) - current_total1 += current_amps1 * dt * 0.0002778; + current_total1 += current_amps1 * dt * 0.0002778f; } last_time_ms = tnow; }