Skip to content

Commit

Permalink
read/write -> get/set
Browse files Browse the repository at this point in the history
  • Loading branch information
jordens committed Nov 14, 2023
1 parent 6182e1c commit 908922f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/hardware/serial_terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ const ROOT_MENU: menu::Menu<Context> = menu::Menu {
command: "reboot",
help: Some("Reboot the device to force new settings to take effect."),
item_type: menu::ItemType::Callback {
function: handle_device_reboot,
function: handle_reboot,
parameters: &[]
},
},
&menu::Item {
command: "factory-reset",
help: Some("Reset the device settings to default values."),
item_type: menu::ItemType::Callback {
function: handle_settings_reset,
function: handle_reset,
parameters: &[]
},
},
Expand All @@ -37,21 +37,21 @@ const ROOT_MENU: menu::Menu<Context> = menu::Menu {
},
},
&menu::Item {
command: "read",
command: "get",
help: Some("Read a setting_from the device."),
item_type: menu::ItemType::Callback {
function: handle_setting_read,
function: handle_get,
parameters: &[menu::Parameter::Mandatory {
parameter_name: "item",
help: Some("The name of the setting to read."),
}]
},
},
&menu::Item {
command: "write",
command: "set",
help: Some("Update a a setting in the device."),
item_type: menu::ItemType::Callback {
function: handle_setting_write,
function: handle_set,
parameters: &[
menu::Parameter::Mandatory {
parameter_name: "item",
Expand Down Expand Up @@ -134,7 +134,7 @@ fn handle_list(
}
}

fn handle_device_reboot(
fn handle_reboot(
_menu: &menu::Menu<Context>,
_item: &menu::Item<Context>,
_args: &[&str],
Expand All @@ -143,7 +143,7 @@ fn handle_device_reboot(
cortex_m::peripheral::SCB::sys_reset();
}

fn handle_settings_reset(
fn handle_reset(
_menu: &menu::Menu<Context>,
_item: &menu::Item<Context>,
_args: &[&str],
Expand All @@ -153,7 +153,7 @@ fn handle_settings_reset(
context.flash.save();
}

fn handle_setting_read(
fn handle_get(
_menu: &menu::Menu<Context>,
item: &menu::Item<Context>,
args: &[&str],
Expand All @@ -173,7 +173,7 @@ fn handle_setting_read(
writeln!(context, "{key}: {stringified}").unwrap();
}

fn handle_setting_write(
fn handle_set(
_menu: &menu::Menu<Context>,
item: &menu::Item<Context>,
args: &[&str],
Expand Down

0 comments on commit 908922f

Please sign in to comment.