Skip to content

Commit

Permalink
use The Queen's english
Browse files Browse the repository at this point in the history
  • Loading branch information
rnpnr committed Mar 28, 2020
1 parent 8bbbfd2 commit 6cf35df
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/embeddedUAVCANDefs/src/uavcanNodeIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#define UAVCAN_NODE_ID_TORPEDO_BOARD 11
#define UAVCAN_NODE_ID_INTERNAL_SENSOR_BOARD 12
#define UAVCAN_NODE_ID_BATTERY_MONITORING_BOARD 13
#define UAVCAN_NODE_ID_BATTERY_LEVELING_BOARD 14
#define UAVCAN_NODE_ID_BATTERY_LEVELLING_BOARD 14

#endif
4 changes: 2 additions & 2 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ build_flags = ${common.build_flags}
lib_ldf_mode = ${common.lib_ldf_mode}
upload_protocol = ${common.upload_protocol}

[env:batt_leveling]
src_filter = +<batt_leveling/*>
[env:batt_levelling]
src_filter = +<batt_levelling/*>
platform = ${common.platform}
board = ${common.board}
framework = ${common.framework}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#include <arvp/BatteryLeveling.hpp>
#include <arvp/BatteryLevelling.hpp>
#include <uavcan/equipment/power/BatteryInfo.hpp>

#include <uavcanNodeIDs.h>
#include <teensy_uavcan.hpp>
#include <watchdog.h>

#include "batt_leveling.h"
#include "batt_levelling.h"

static const char *nodename = "org.arvp.batteryleveling";
static const char *nodename = "org.arvp.batterylevelling";

static Subscriber<equipment::power::BatteryInfo> *batt_subscriber;
static Publisher<arvp::BatteryLeveling> *batt_level_publisher;
static Publisher<arvp::BatteryLevelling> *batt_level_publisher;

static int ee_batt_state;
static int motor_batt_state;
Expand Down Expand Up @@ -56,15 +56,15 @@ batt_info_callback(const uavcan::equipment::power::BatteryInfo& batt_data)
}

static void
publish_leveling_info(void)
publish_levelling_info(void)
{
arvp::BatteryLeveling leveling_info;
arvp::BatteryLevelling levelling_info;

leveling_info.ee_batt_state = ee_batt_state;
leveling_info.motor_batt_state = motor_batt_state;
levelling_info.ee_batt_state = ee_batt_state;
levelling_info.motor_batt_state = motor_batt_state;

if (batt_level_publisher->broadcast(leveling_info) < 0)
Serial.println("Failed to publish Battery Leveling info");
if (batt_level_publisher->broadcast(levelling_info) < 0)
Serial.println("Failed to publish Battery Levelling info");
}

static void
Expand All @@ -86,10 +86,10 @@ init_subscriber(Node<NodeMemoryPoolSize> *node)
static void
init_publisher(Node<NodeMemoryPoolSize> *node)
{
batt_level_publisher = new Publisher<arvp::BatteryLeveling>(*node);
batt_level_publisher = new Publisher<arvp::BatteryLevelling>(*node);

if (batt_level_publisher->init() < 0)
Serial.println("Failed to start Battery Leveling publisher");
Serial.println("Failed to start Battery Levelling publisher");

batt_level_publisher->setTxTimeout(MonotonicDuration::fromUSec(800));
}
Expand All @@ -106,7 +106,7 @@ setup(void)
systemClock = &initSystemClock();
canDriver = &initCanDriver();
node = new Node<NodeMemoryPoolSize>(*canDriver, *systemClock);
initNode(node, UAVCAN_NODE_ID_BATTERY_LEVELING_BOARD, nodename, SW_VERSION, HW_VERSION);
initNode(node, UAVCAN_NODE_ID_BATTERY_LEVELLING_BOARD, nodename, SW_VERSION, HW_VERSION);

init_subscriber(node);
init_publisher(node);
Expand Down Expand Up @@ -143,7 +143,7 @@ loop(void)

delay(500);

publish_leveling_info();
publish_levelling_info();

if (voltages[0] > EE_MIN_VOLTAGE)
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* batt_leveling firmware info */
#define ENABLE_BATT_DEBUG 0
/* batt_levelling firmware info */
#define SW_VERSION 1
#define HW_VERSION 1

Expand Down

0 comments on commit 6cf35df

Please sign in to comment.