Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting/disabling Emergency Stop during setup/via Serial commands #1

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ obj/
.idea
.vs
.vscode
*.generated.sln
*.sln
10 changes: 10 additions & 0 deletions HubConfig.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ table RFConfig {
keepalive_enabled:bool;
}

table EStopConfig {
enabled:bool;

/// The GPIO pin connected to the E-Stop button
gpio_pin:uint8;
}

table WiFiCredentials {
/// ID of the WiFi network credentials, used for referencing the credentials with a low memory footprint
id:uint8;
Expand Down Expand Up @@ -118,4 +125,7 @@ table HubConfig {

/// OTA update configuration
ota_update:OtaUpdateConfig;

/// E-Stop configuration
estop:EStopConfig;
}
20 changes: 17 additions & 3 deletions HubToLocalMessage.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,24 @@ struct AccountLinkCommandResult {
result:AccountLinkResultCode;
}

enum SetRfPinResultCode : uint8 {
enum SetGPIOResultCode : uint8 {
Success = 0,
InvalidPin = 1,
InternalError = 2
}
struct SetRfTxPinCommandResult {
pin:uint8;
result:SetRfPinResultCode;
result:SetGPIOResultCode;
}

struct SetEstopEnabledCommandResult {
enabled:bool;
success:bool;
}

struct SetEstopPinCommandResult {
gpio_pin:uint8;
result:SetGPIOResultCode;
}

union HubToLocalMessagePayload {
Expand All @@ -72,7 +82,11 @@ union HubToLocalMessagePayload {
AccountLinkCommandResult,

// RF transmitter stuff
SetRfTxPinCommandResult
SetRfTxPinCommandResult,

// E-stop stuff
SetEstopEnabledCommandResult,
SetEstopPinCommandResult
}

table HubToLocalMessage (fs_serializer) {
Expand Down
12 changes: 11 additions & 1 deletion LocalToHubMessage.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ struct AccountUnlinkCommand {
struct SetRfTxPinCommand {
pin:uint8;
}
struct SetEstopEnabledCommand {
enabled:bool;
}
struct SetEstopPinCommand {
pin:uint8;
}

union LocalToHubMessagePayload {

Expand All @@ -84,7 +90,11 @@ union LocalToHubMessagePayload {
AccountUnlinkCommand,

// RF Transmitter stuff
SetRfTxPinCommand
SetRfTxPinCommand,

// E-Stop stuff
SetEstopEnabledCommand,
SetEstopPinCommand
}

table LocalToHubMessage (fs_serializer) {
Expand Down