diff --git a/.travis.yml b/.travis.yml index df4ce2d..c269308 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ before_script: - gcc --version - arm-none-eabi-gcc --version - python3 --version - - sudo apt-get install -y python3-pip + - sudo apt-get install -y python3-pip setuptools - pip3 install --user adafruit-nrfutil script: diff --git a/Makefile b/Makefile index 4e13ce2..585bd07 100644 --- a/Makefile +++ b/Makefile @@ -457,11 +457,11 @@ $(BUILD)/%.o: %.S $(QUIET)$(CC) $(ASMFLAGS) $(INC_PATHS) -c -o $@ $< # Link -$(BUILD)/$(OUTPUT_FILENAME).out: $(BUILD) $(OBJECTS) - @echo LD $(OUTPUT_FILENAME).out - $(QUIET)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $(BUILD)/$(OUTPUT_FILENAME).out +$(BUILD)/$(OUTPUT_FILENAME)-nosd.out: $(BUILD) $(OBJECTS) + @echo LD $(OUTPUT_FILENAME)-nosd.out + $(QUIET)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $@ -size: $(BUILD)/$(OUTPUT_FILENAME).out +size: $(BUILD)/$(OUTPUT_FILENAME)-nosd.out -@echo '' $(QUIET)$(SIZE) $< -@echo '' @@ -473,22 +473,22 @@ size: $(BUILD)/$(OUTPUT_FILENAME).out ## Create binary .hex file from the .out file genhex: $(BUILD)/$(OUTPUT_FILENAME).hex -$(BUILD)/$(OUTPUT_FILENAME).hex: $(BUILD)/$(OUTPUT_FILENAME).out - @echo CR $(OUTPUT_FILENAME).hex +$(BUILD)/$(OUTPUT_FILENAME)-nosd.hex: $(BUILD)/$(OUTPUT_FILENAME)-nosd.out + @echo CR $(OUTPUT_FILENAME)-nosd.hex $(QUIET)$(OBJCOPY) -O ihex $< $@ # merge bootloader and sd hex together combinehex: $(BUILD)/$(MERGED_FNAME).hex -$(BUILD)/$(MERGED_FNAME).hex: $(BUILD)/$(OUTPUT_FILENAME).hex +$(BUILD)/$(MERGED_FNAME).hex: $(BUILD)/$(OUTPUT_FILENAME)-nosd.hex @echo CR $(MERGED_FNAME).hex @mergehex -q -m $< $(SD_HEX) -o $@ ## Create pkg file for bootloader+SD combo to use with DFU genpkg: $(BUILD)/$(MERGED_FNAME).zip -$(BUILD)/$(MERGED_FNAME).zip: $(BUILD)/$(OUTPUT_FILENAME).hex +$(BUILD)/$(MERGED_FNAME).zip: $(BUILD)/$(OUTPUT_FILENAME)-nosd.hex @$(NRFUTIL) dfu genpkg --dev-type 0x0052 --dev-revision $(DFU_DEV_REV) --bootloader $< --softdevice $(SD_HEX) $@ # Create SD+bootloader combo with hex & dfu package at release folder diff --git a/src/boards.c b/src/boards.c index 5a13308..49f2a0a 100644 --- a/src/boards.c +++ b/src/boards.c @@ -251,7 +251,7 @@ void led_state(uint32_t state) } else if (temp_color_active) { final_color = (uint8_t*)&rgb_color; } - #if LED_NEOPIXEL || defined(LED_RGB_RED) + #if LED_NEOPIXEL || defined(LED_RGB_RED_PIN) if (final_color != NULL) { neopixel_write(final_color); } @@ -375,6 +375,9 @@ void neopixel_teardown(void) { uint8_t grb[3] = { 0, 0, 0 }; neopixel_write(grb); + nrf_gpio_cfg_default(LED_RGB_RED_PIN); + nrf_gpio_cfg_default(LED_RGB_GREEN_PIN); + nrf_gpio_cfg_default(LED_RGB_BLUE_PIN); } // write 3 bytes color to a built-in neopixel diff --git a/src/boards.h b/src/boards.h index e8604ba..514801c 100644 --- a/src/boards.h +++ b/src/boards.h @@ -47,6 +47,12 @@ // The secondary LED, when available, is usually blue. #define LED_SECONDARY 1 +// Its more common for LEDs to be sinking to the MCU pin. Setting is only for individual LEDs, not +// RGB LEDs. +#ifndef LED_STATE_ON +#define LED_STATE_ON 0 +#endif + // Internal status colors are masked by this brightness setting. #ifndef BOARD_RGB_BRIGHTNESS #define BOARD_RGB_BRIGHTNESS 0x101010 diff --git a/src/boards/particle_boron.h b/src/boards/particle_boron.h index 456df52..8ff1959 100644 --- a/src/boards/particle_boron.h +++ b/src/boards/particle_boron.h @@ -44,11 +44,13 @@ *------------------------------------------------------------------*/ #define LEDS_NUMBER 1 #define LED_PRIMARY_PIN _PINNUM(1, 12) -#define LED_STATE_ON 0 +#define LED_STATE_ON 1 #define LED_RGB_RED_PIN _PINNUM(0, 13) #define LED_RGB_GREEN_PIN _PINNUM(0, 14) #define LED_RGB_BLUE_PIN _PINNUM(0, 15) +#define BOARD_RGB_BRIGHTNESS 0x202020 + /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ diff --git a/tools/build_all.py b/tools/build_all.py index d524b05..e8e40fd 100644 --- a/tools/build_all.py +++ b/tools/build_all.py @@ -39,7 +39,7 @@ for board in all_boards: for entry in os.scandir("_build-{}".format(board)): for extension in ["zip", "hex"]: - if entry.name.endswith(extension): + if entry.name.endswith(extension) and "nosd" not in entry.name: shutil.copy(entry.path, bin_directory) if travis: