add button_handler outline #29
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
priority
high
priority
low
priority
medium
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TTK4145/elevator!29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "button_handler"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #6
add button_handler outlineto WIP: add button_handler outlineWIP: add button_handler outlineto add button_handler outline@ -0,0 +8,4 @@use std::sync::RwLock;#[derive(PartialEq)]enum CallTypes {Why does this type exist, doccoment please?
bc it is just consts in the elevator driver, added a doc comment
@ -0,0 +15,4 @@}/// Converts a value from u8 to an option with [CallTypes]fn convert_to_call_types(value: u8) -> Option<CallTypes> {Why is this not a
TryInto?added
@ -0,0 +25,4 @@}/// Converts a value from u8 to an option [Destination]fn convert_to_destination(value: u8) -> Option<Destination> {Why is this not
TryInto?that is a good question, it is bc it is implemented in the elevator driver soooo
fixed
@ -0,0 +27,4 @@/// Converts a value from u8 to an option [Destination]fn convert_to_destination(value: u8) -> Option<Destination> {match value {// todo!("Needs todoing"),delete comment
done
@ -0,0 +117,4 @@call_button_rx: Receiver<CallButton>,) {loop {let _ = button_handler(state.clone(), &call_button_rx).await;button_handlerdoes not return a value, as suchlet _ =is not necessary.removed
@ -0,0 +86,4 @@let destination = convert_to_destination(message.floor);let call_type = convert_to_call_types(message.call);if call_type == None || destination == None {non-blocker, but
.is_none()is preferred over== Nonefixed
@ -0,0 +90,4 @@return;}match call_type.unwrap() {Is this unwrap safe?
fixed, but it was
@ -0,0 +94,4 @@CallTypes::HallDown => {add_hall_call_to_systemstate(system_state.clone(),destination.unwrap(),Is this unwrap safe?
i fixed it
but it was
Assuming all is good because you definitely fixed all my comments and I am too tired to do a proper review of this code and it would be nice to get it merged today so we can test rather than waiting for Friday.
:02love: