Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
laurensvalk committed Sep 2, 2024
1 parent 5452453 commit 8fc935b
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
@@ -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
1 change: 1 addition & 0 deletions lib/pbio/platform/city_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
@@ -15,5 +15,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
@@ -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
@@ -13,5 +13,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
@@ -10,6 +10,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
@@ -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 (1)
1 change: 1 addition & 0 deletions lib/pbio/platform/move_hub/pbsysconfig.h
Original file line number Diff line number Diff line change
@@ -15,5 +15,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
@@ -9,6 +9,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
@@ -15,5 +15,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
@@ -15,5 +15,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
@@ -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
@@ -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();
Loading

0 comments on commit 8fc935b

Please sign in to comment.