Skip to content

Commit

Permalink
feedback from Eliza
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron-Hartwig committed May 14, 2024
1 parent 23fde80 commit 757b3cf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 7 additions & 0 deletions drv/sidecar-front-io/src/transceivers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ impl LogicalPort {
PortLocation::from(*self)
}
}

impl From<usize> for LogicalPort {
fn from(value: usize) -> Self {
Self(value as u8)
}
}

/// Represents a set of selected logical ports, i.e. a 32-bit bitmask
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
pub struct LogicalPortMask(pub u32);
Expand Down
11 changes: 6 additions & 5 deletions drv/transceivers-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
#![no_main]

use counters::Count;
use idol_runtime::{NotificationHandler, RequestError};
use multitimer::{Multitimer, Repeat};
use ringbuf::*;
use static_cell::ClaimOnceCell;
use userlib::{sys_get_timer, task_slot, units::Celsius};

use drv_fpga_api::FpgaError;
Expand All @@ -21,9 +24,6 @@ use drv_transceivers_api::{
ModuleStatus, TransceiversError, NUM_PORTS, TRANSCEIVER_TEMPERATURE_SENSORS,
};
use enum_map::Enum;
use idol_runtime::{NotificationHandler, RequestError};
use multitimer::{Multitimer, Repeat};
use static_cell::ClaimOnceCell;
use task_sensor_api::{NoData, Sensor};
use task_thermal_api::{Thermal, ThermalError, ThermalProperties};
use transceiver_messages::{
Expand All @@ -46,8 +46,9 @@ include!(concat!(env!("OUT_DIR"), "/i2c_config.rs"));
#[allow(dead_code)]
#[derive(Copy, Clone, PartialEq, Eq, Count)]
enum Trace {
#[count(skip)]
None,
FrontIOBoardReady(bool),
FrontIOBoardReady(#[count(children)] bool),
FrontIOSeqErr(SeqError),
LEDInit,
LEDInitComplete,
Expand All @@ -58,7 +59,7 @@ enum Trace {
LEDReadError(Error),
LEDUpdateError(Error),
ModulePresenceUpdate(LogicalPortMask),
TransceiversError(TransceiversError),
TransceiversError(#[count(children)] TransceiversError),
GotInterface(u8, ManagementInterface),
UnknownInterface(u8, ManagementInterface),
UnpluggedModule(usize),
Expand Down
3 changes: 2 additions & 1 deletion drv/transceivers-server/src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//! ports, i.e. an FPGA paired by a physical port index (or mask).
//!
use counters::Count;
use hubpack::SerializedSize;
use ringbuf::*;
use userlib::UnwrapLite;

Expand All @@ -20,7 +21,6 @@ use drv_sidecar_front_io::transceivers::{
FpgaI2CFailure, LogicalPort, LogicalPortFailureTypes, LogicalPortMask,
ModuleResult, ModuleResultNoFailure, ModuleResultSlim, PortI2CStatus,
};
use hubpack::SerializedSize;
use task_net_api::*;
use transceiver_messages::{
mac::MacAddrs,
Expand All @@ -33,6 +33,7 @@ use transceiver_messages::{

#[derive(Copy, Clone, PartialEq, Count)]
enum Trace {
#[count(skip)]
None,
DeserializeError(hubpack::Error),
DeserializeHeaderError(hubpack::Error),
Expand Down

0 comments on commit 757b3cf

Please sign in to comment.