Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Tools/AP_Periph/AP_Periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,15 @@ class AP_Periph_FW {
AP_Notify notify;
uint64_t vehicle_state = 1; // default to initialisation
float yaw_earth;
uint32_t last_vehicle_state;
uint32_t last_vehicle_state_ms;

// Handled under LUA script to control LEDs
float get_yaw_earth() { return yaw_earth; }
uint32_t get_vehicle_state() { return vehicle_state; }
uint64_t get_vehicle_state() { return vehicle_state; }
#elif defined(AP_SCRIPTING_ENABLED)
// create dummy methods for the case when the user doesn't want to use the notify object
float get_yaw_earth() { return 0.0; }
uint32_t get_vehicle_state() { return 0.0; }
uint64_t get_vehicle_state() { return 0; }
#endif

#if AP_SCRIPTING_ENABLED
Expand Down
2 changes: 1 addition & 1 deletion Tools/AP_Periph/can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ void AP_Periph_FW::handle_notify_state(CanardInstance* canard_instance, CanardRx
yaw_earth = radians((float)tmp * 0.01f);
}
vehicle_state = msg.vehicle_state;
last_vehicle_state = AP_HAL::millis();
last_vehicle_state_ms = AP_HAL::millis();
}
#endif // AP_PERIPH_NOTIFY_ENABLED

Expand Down