fix tread safty issues by annotating Box Traits correctly
This commit is contained in:
@@ -12,7 +12,7 @@ pub struct Initial<'a> {
|
||||
pub(crate) general_fault: PinDriver<'a, esp_idf_hal::gpio::AnyIOPin, InputOutput>,
|
||||
pub(crate) esp: ESP<'a>,
|
||||
pub(crate) config: PlantControllerConfig,
|
||||
pub(crate) battery: Box<dyn BatteryInteraction>,
|
||||
pub(crate) battery: Box<dyn BatteryInteraction + Send>,
|
||||
}
|
||||
|
||||
pub(crate) fn create_initial_board(
|
||||
@@ -20,7 +20,7 @@ pub(crate) fn create_initial_board(
|
||||
fs_mount_error: bool,
|
||||
config: PlantControllerConfig,
|
||||
esp: ESP<'static>,
|
||||
) -> Result<Box<dyn BoardInteraction<'static>> + Send + Sync> {
|
||||
) -> Result<Box<dyn BoardInteraction<'static> + Send>> {
|
||||
let mut general_fault = PinDriver::input_output(free_pins.gpio6.downgrade())?;
|
||||
general_fault.set_pull(Pull::Floating)?;
|
||||
general_fault.set_low()?;
|
||||
@@ -46,7 +46,7 @@ impl<'a> BoardInteraction<'a> for Initial<'a> {
|
||||
&self.config
|
||||
}
|
||||
|
||||
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction> {
|
||||
fn get_battery_monitor(&mut self) -> &mut Box<dyn BatteryInteraction + Send> {
|
||||
&mut self.battery
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user