Skip to content

Commit

Permalink
pbio/sys/light: Remove ble low signal light.
Browse files Browse the repository at this point in the history
These are never used, implemented, or documented, so they can be removed.
  • Loading branch information
laurensvalk committed Sep 3, 2024
1 parent de12ee5 commit b5ed2b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion lib/pbio/include/pbio/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ typedef enum {
*/
PBIO_PYBRICKS_STATUS_BLE_ADVERTISING = 3,
/**
* Bluetooth Low Energy has low signal.
* Bluetooth Low Energy has low signal. Not implemented or used anywhere.
*
* @since Pybricks Profile v1.0.0
*/
Expand Down
25 changes: 0 additions & 25 deletions lib/pbio/sys/light.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ typedef enum {
PBSYS_STATUS_LIGHT_INDICATION_LOW_VOLTAGE,
PBSYS_STATUS_LIGHT_INDICATION_BLE_ADVERTISING,
PBSYS_STATUS_LIGHT_INDICATION_BLE_ADVERTISING_AND_LOW_VOLTAGE,
PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL,
PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL_AND_LOW_VOLTAGE,
PBSYS_STATUS_LIGHT_INDICATION_BLE_CONNECTED_IDLE,
PBSYS_STATUS_LIGHT_INDICATION_BLE_CONNECTED_IDLE_AND_LOW_VOLTAGE,
PBSYS_STATUS_LIGHT_INDICATION_SHUTDOWN_REQUESTED,
Expand Down Expand Up @@ -100,24 +98,6 @@ pbsys_status_light_indication_pattern[] = {
{ .color = PBIO_COLOR_BLACK, .duration = 22 },
PBSYS_STATUS_LIGHT_INDICATION_PATTERN_REPEAT
},
[PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL] =
(const pbsys_status_light_indication_pattern_element_t[]) {
{ .color = PBIO_COLOR_NONE, .duration = 8 },
{ .color = PBIO_COLOR_WHITE, .duration = 1 },
PBSYS_STATUS_LIGHT_INDICATION_PATTERN_REPEAT
},
[PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL_AND_LOW_VOLTAGE] =
(const pbsys_status_light_indication_pattern_element_t[]) {
{ .color = PBIO_COLOR_NONE, .duration = 8 },
{ .color = PBIO_COLOR_BLACK, .duration = 4 },
{ .color = PBIO_COLOR_ORANGE, .duration = 6 },
{ .color = PBIO_COLOR_BLACK, .duration = 8 },
{ .color = PBIO_COLOR_ORANGE, .duration = 6 },
{ .color = PBIO_COLOR_BLACK, .duration = 4 },
{ .color = PBIO_COLOR_NONE, .duration = 8 },
{ .color = PBIO_COLOR_WHITE, .duration = 1 },
PBSYS_STATUS_LIGHT_INDICATION_PATTERN_REPEAT
},
[PBSYS_STATUS_LIGHT_INDICATION_BLE_CONNECTED_IDLE] =
(const pbsys_status_light_indication_pattern_element_t[]) {
PBSYS_STATUS_LIGHT_INDICATION_PATTERN_FOREVER(PBIO_COLOR_BLUE),
Expand Down Expand Up @@ -198,7 +178,6 @@ static void pbsys_status_light_handle_status_change(void) {
bool ble_connected_idle = pbsys_status_test(PBIO_PYBRICKS_STATUS_BLE_HOST_CONNECTED) &&
!pbsys_status_test(PBIO_PYBRICKS_STATUS_USER_PROGRAM_RUNNING);
bool ble_advertising = pbsys_status_test(PBIO_PYBRICKS_STATUS_BLE_ADVERTISING);
bool ble_low_signal = pbsys_status_test(PBIO_PYBRICKS_STATUS_BLE_LOW_SIGNAL);
bool low_voltage = pbsys_status_test(PBIO_PYBRICKS_STATUS_BATTERY_LOW_VOLTAGE_WARNING);
bool high_current = pbsys_status_test(PBIO_PYBRICKS_STATUS_BATTERY_HIGH_CURRENT);
bool shutdown_requested = pbsys_status_test(PBIO_PYBRICKS_STATUS_SHUTDOWN_REQUEST);
Expand All @@ -215,10 +194,6 @@ static void pbsys_status_light_handle_status_change(void) {
new_indication = PBSYS_STATUS_LIGHT_INDICATION_BLE_ADVERTISING;
} else if (high_current) {
new_indication = PBSYS_STATUS_LIGHT_INDICATION_HIGH_CURRENT;
} else if (ble_low_signal && low_voltage) {
new_indication = PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL_AND_LOW_VOLTAGE;
} else if (ble_low_signal) {
new_indication = PBSYS_STATUS_LIGHT_INDICATION_BLE_LOW_SIGNAL;
} else if (ble_connected_idle && low_voltage) {
new_indication = PBSYS_STATUS_LIGHT_INDICATION_BLE_CONNECTED_IDLE_AND_LOW_VOLTAGE;
} else if (ble_connected_idle) {
Expand Down

0 comments on commit b5ed2b1

Please sign in to comment.