Skip to content

Commit

Permalink
Merge pull request #67 from CarbonixUAV/feature/OV3-916-fuel-level-co…
Browse files Browse the repository at this point in the history
…de-update

Feature/ov3 916 fuel level code update
  • Loading branch information
Jono453 authored Aug 11, 2023
2 parents c0ac928 + 64bab93 commit b90c442
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions ArduPlane/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Release Ottano Carbopilot V4.3.25 11th August 2023
----------------------------------

This release includes:
- OV3-916 update fuel level sensor code to 1min avereage

Release Ottano Carbopilot V4.3.24 28th Jul 2023
----------------------------------

Expand Down
2 changes: 1 addition & 1 deletion ArduPlane/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "ap_version.h"

#define THISFIRMWARE "Ottano Carbopilot V4.3.24"
#define THISFIRMWARE "Ottano Carbopilot V4.3.25"

// the following line is parsed by the autotest scripts
#define FIRMWARE_VERSION 4,2,1,FIRMWARE_VERSION_TYPE_OFFICIAL
Expand Down
4 changes: 2 additions & 2 deletions Tools/AP_Periph/AP_Periph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ void AP_Periph_FW::update()
#endif

#ifdef HAL_PERIPH_ENABLE_BATTERY
if (now - battery.last_read_ms >= 100) {
// update battery at 10Hz
if (now - battery.last_read_ms >= 1000) {
// update battery at 1Hz
battery.last_read_ms = now;
battery.lib.read();
}
Expand Down
4 changes: 2 additions & 2 deletions Tools/AP_Periph/can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1749,8 +1749,8 @@ void AP_Periph_FW::can_battery_update(void)
{
#ifdef HAL_PERIPH_ENABLE_BATTERY
const uint32_t now_ms = AP_HAL::native_millis();
if (now_ms - battery.last_can_send_ms < 100) {
return;
if (now_ms - battery.last_can_send_ms < 1000) {
return; //change to 1Hz rate
}
battery.last_can_send_ms = now_ms;

Expand Down
2 changes: 1 addition & 1 deletion Tools/AP_Periph/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef __AP_PERIPH_FW_VERSION__
#define __AP_PERIPH_FW_VERSION__

#define THISFIRMWARE "Ottano Carbopilot V4.3.24"
#define THISFIRMWARE "Ottano Carbopilot V4.3.25"

// the following line is parsed by the autotest scripts
#define FIRMWARE_VERSION 1,3,0,FIRMWARE_VERSION_TYPE_DEV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const AP_Param::GroupInfo AP_BattMonitor_FuelLevel_Analog::var_info[] = {

// @Param: LS800_MAX_LEVEL
// @DisplayName: LS800 maximum fuel level
AP_GROUPINFO("LS800_MAX", 46, AP_BattMonitor_FuelLevel_Analog, _ls800_max_fuel_level_litres, 1),
AP_GROUPINFO("LS800_MAX", 44, AP_BattMonitor_FuelLevel_Analog, _ls800_max_fuel_level_litres, 1),

// Param indexes must be between 40 and 49 to avoid conflict with other battery monitor param tables loaded by pointer

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_BattMonitor/AP_BattMonitor_FuelLevel_Analog.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define LS800_FIT_THIRD_COEFF -0.0213
#define LS800_FIT_OFFSET 0.1766

#define FILTER_MAX 60
#define FILTER_MAX 60 //battery monitor called at 1Hz

class AP_BattMonitor_FuelLevel_Analog : public AP_BattMonitor_Backend
{
Expand Down

0 comments on commit b90c442

Please sign in to comment.