Skip to content

Commit

Permalink
Firmware 1.03 update
Browse files Browse the repository at this point in the history
  • Loading branch information
flyandi committed May 12, 2019
1 parent a267a3b commit 5deae06
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
3 changes: 2 additions & 1 deletion configurator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
},
"mac": {
"icon": "app/icons/icons.icns",
"category": "public.app-category.productivity"
"category": "public.app-category.productivity",
"darkModeSupport": true
},
"win": {
"icon": "app/icons/icon.ico",
Expand Down
39 changes: 31 additions & 8 deletions firmware/bitsyled/bitsyled.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "bitsyled_ws2812.h"

// @version
#define VERSION 102
#define VERSION 103


// @serial configuration
Expand Down Expand Up @@ -108,6 +108,10 @@ cRGB color;
};
#endif

#ifdef USE_STATUS_LED
bool status_led_b = false;
#endif



// @header
Expand Down Expand Up @@ -165,6 +169,27 @@ uint8_t bexb(uint8_t n, uint8_t o, uint8_t l) {
}


/**
@status_led
- Turns of when in program
- Flash super fast when in serial operation
- Flash within 1.5s when idle
*/
void status_led(bool operation) {
// status led
#ifdef USE_STATUS_LED
if(range_a > 0) {
digitalWrite(PIN_STATUS_LED, 0);
} else if(operation) {
status_led_b != status_led_b;
digitalWrite(PIN_STATUS_LED, status_led_b);
} else {
digitalWrite(PIN_STATUS_LED, bitRead(timers_s, 6));
}
#endif
}


/**
@prepare_led
Bit
Expand Down Expand Up @@ -340,8 +365,8 @@ void mux_ranges() {
*/
void identify_strand() {
clear_all();
color.r = 255;
color.g = 0;
color.r = 0;
color.g = 255;
color.b = 0;
for(uint8_t n = 0; n < NUM_STRANDS; n++) {
strands_a[n].set_color(0, color);
Expand Down Expand Up @@ -393,11 +418,12 @@ void begin_update() {
} else {
wait = millis() - timeout < SERIAL_TIMEOUT;
}
status_led(true);
}
uint8_t r[3] = {SERIAL_COMMAND_DONE, lowByte(address), highByte(address)};

serial.write(r, 3);

recover();
}

Expand Down Expand Up @@ -550,10 +576,7 @@ void loop() {
}
#endif

// status led
#ifdef USE_STATUS_LED
digitalWrite(PIN_STATUS_LED, bitRead(timers_s, 6));
#endif
status_led(false);
}

delay(15); // save timer
Expand Down
4 changes: 3 additions & 1 deletion firmware/bitsyled/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// Firmware flags
#define ENABLE_LIVE_CHANNEL
//#define ENABLE_LOCAL_DEV
//#define ENABLE_LOCAL_DEV // Easier to dev this way


/**
Expand All @@ -30,6 +30,7 @@
#define STATIC_HEADER // Ignores header from serial
#define USE_SOFT_SERIAL // Use software serial
#define SERIAL_BAUD_RATE 9600
#define USE_STATUS_LED // Supported since 1.2 board

#ifdef ENABLE_LOCAL_DEV
#define SERIAL_RX_PIN 0
Expand All @@ -42,6 +43,7 @@
#endif

// board configs
#define PIN_STATUS_LED 7
#define NUM_RANGES 5
#define NUM_STRANDS 3
#define NUM_LEDS 10
Expand Down

0 comments on commit 5deae06

Please sign in to comment.