Skip to content

Commit

Permalink
pbio/sys/light: Split Bluetooth light patterns.
Browse files Browse the repository at this point in the history
This separates the combined status light patterns
into Bluetooth patterns with warning pattern
overlays.

On hubs with a separate Bluetooth light, these
can be displayed separately.

This also simplifies the warning light. Instead
of having three orange patterns with different
meanings, this introduces a single orange pattern
for low battery and a red patterm for high current.
  • Loading branch information
laurensvalk committed Sep 3, 2024
1 parent b5ed2b1 commit e1223cc
Show file tree
Hide file tree
Showing 20 changed files with 171 additions and 155 deletions.
2 changes: 1 addition & 1 deletion lib/pbio/include/pbsys/light.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#if PBSYS_CONFIG_STATUS_LIGHT
#include <pbio/light.h>
extern pbio_color_light_t *pbsys_status_light;
extern pbio_color_light_t *pbsys_status_light_main;
#endif

#if PBSYS_CONFIG_HUB_LIGHT_MATRIX
Expand Down
1 change: 1 addition & 0 deletions lib/pbio/platform/city_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/debug/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/essential_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/ev3/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define PBSYS_CONFIG_STATUS_LIGHT (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_USER_PROGRAM_AUTO_START (1)
#define PBSYS_CONFIG_PROGRAM_STOP (0)
1 change: 1 addition & 0 deletions lib/pbio/platform/ev3rt/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (0)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/move_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/nxt/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define PBSYS_CONFIG_STATUS_LIGHT (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_USER_PROGRAM_AUTO_START (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/prime_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (1)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (0)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/technic_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (1)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (1)
#define PBSYS_CONFIG_PROGRAM_STOP (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/virtual_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
#define PBSYS_CONFIG_STATUS_LIGHT (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BATTERY (0)
#define PBSYS_CONFIG_STATUS_LIGHT_BLUETOOTH (0)
#define PBSYS_CONFIG_STATUS_LIGHT_STATE_ANIMATIONS (1)
#define PBSYS_CONFIG_USER_PROGRAM (0)
#define PBSYS_CONFIG_PROGRAM_STOP (0)
1 change: 0 additions & 1 deletion lib/pbio/sys/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ void pbsys_init(void) {

void pbsys_deinit(void) {

pbsys_status_light_bluetooth_deinit();
pbsys_storage_deinit();

uint32_t start = pbdrv_clock_get_ms();
Expand Down
Loading

0 comments on commit e1223cc

Please sign in to comment.