Add build script and hook it into Travis

This commit is contained in:
Scott Shawcroft
2018-12-04 15:18:49 -08:00
parent 2ece2daf90
commit 1b35dbf643
32 changed files with 128 additions and 90081 deletions

View File

@ -45,12 +45,11 @@
#define SCHED_MAX_EVENT_DATA_SIZE sizeof(app_timer_event_t) /**< Maximum size of scheduler events. */
#define SCHED_QUEUE_SIZE 30 /**< Maximum number of events in the scheduler queue. */
//------------- IMPLEMENTATION -------------//
#ifdef OUTPUT_500HZ_PIN
void init_clock_pwm(uint32_t pin);
void clock_pwm_teardown(void);
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN)
void neopixel_write(uint8_t *pixels);
#endif
//------------- IMPLEMENTATION -------------//
void board_init(void)
{
// stop LF clock just in case we jump from application without reset
@ -240,16 +239,25 @@ void led_state(uint32_t state)
default:
break;
}
uint8_t* final_color = NULL;
new_rgb_color &= BOARD_RGB_BRIGHTNESS;
if (temp_color != 0){
neopixel_write((uint8_t*)&temp_color);
temp_color &= BOARD_RGB_BRIGHTNESS;
final_color = (uint8_t*)&temp_color;
temp_color_active = true;
} else if (new_rgb_color != rgb_color) {
neopixel_write((uint8_t*)&new_rgb_color);
final_color = (uint8_t*)&new_rgb_color;
rgb_color = new_rgb_color;
} else if (temp_color_active) {
neopixel_write((uint8_t*)&rgb_color);
final_color = (uint8_t*)&rgb_color;
}
#if LED_NEOPIXEL || defined(LED_RGB_RED)
if (final_color != NULL) {
neopixel_write(final_color);
}
#else
(void) final_color;
#endif
}
#if LED_NEOPIXEL
@ -377,9 +385,3 @@ void neopixel_write (uint8_t *pixels)
led_pwm_duty_cycle(LED_RGB_BLUE, pixels[0]);
}
#endif
#if !LED_NEOPIXEL && !defined(LED_RGB_RED)
void neopixel_write(uint8_t* pixels) {
(void) pixels;
}
#endif

View File

@ -47,7 +47,7 @@
// The secondary LED, when available, is usually blue.
#define LED_SECONDARY 1
// The internal
// Internal status colors are masked by this brightness setting.
#ifndef BOARD_RGB_BRIGHTNESS
#define BOARD_RGB_BRIGHTNESS 0x101010
#endif
@ -84,10 +84,6 @@ void led_pwm_enable(uint32_t led_index);
void led_state(uint32_t state);
void led_tick(void);
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN)
void neopixel_write(uint8_t *pixels);
#endif
//--------------------------------------------------------------------+
// BUTTONS
//--------------------------------------------------------------------+

View File

@ -42,7 +42,7 @@
*------------------------------------------------------------------*/
#define LEDS_NUMBER 2
#define LED_PRIMARY_PIN 17 // Red
#define LED_SECODARY_PIN 19 // Blue
#define LED_SECONDARY_PIN 19 // Blue
#define LED_STATE_ON 1
/*------------------------------------------------------------------*/

View File

@ -66,12 +66,11 @@
#define RTS_PIN_NUMBER 5
#define HWFC false
#define OUTPUT_500HZ_PIN _PINNUM(0, 05) // A1
// Used as model string in OTA mode
#define DIS_MANUFACTURER "Adafruit Industries"
#define DIS_MODEL "Bluefruit Feather nRF52840 Express"
#define PRODUCT_NAME "Adafruit Feather nRF52840 Express"
#define VOLUME_LABEL "FTHR840BOOT"
#endif // _FEATHER52840_H

View File

@ -42,10 +42,13 @@
/*------------------------------------------------------------------*/
/* LED
*------------------------------------------------------------------*/
#define LEDS_NUMBER 2
#define LED_RED _PINNUM(0, 13)
#define LED_BLUE _PINNUM(0, 15)
#define LED_STATE_ON 0
#define LEDS_NUMBER 1
#define LED_PRIMARY_PIN _PINNUM(1, 12)
#define LED_STATE_ON 0
#define LED_RGB_RED_PIN _PINNUM(0, 13)
#define LED_RGB_GREEN_PIN _PINNUM(0, 14)
#define LED_RGB_BLUE_PIN _PINNUM(0, 15)
/*------------------------------------------------------------------*/
/* BUTTON

View File

@ -66,8 +66,6 @@
#define RTS_PIN_NUMBER 0
#define HWFC false
#define OUTPUT_500HZ_PIN _PINNUM(0, 04) // A1
// Used as model string in OTA mode
#define DIS_MANUFACTURER "Particle Industries"
#define DIS_MODEL "Boron"

View File

@ -42,10 +42,13 @@
/*------------------------------------------------------------------*/
/* LED
*------------------------------------------------------------------*/
#define LEDS_NUMBER 2
#define LED_RED _PINNUM(0, 13)
#define LED_BLUE _PINNUM(0, 15)
#define LED_STATE_ON 0
#define LEDS_NUMBER 1
#define LED_PRIMARY_PIN _PINNUM(1, 12)
#define LED_STATE_ON 0
#define LED_RGB_RED_PIN _PINNUM(0, 13)
#define LED_RGB_GREEN_PIN _PINNUM(0, 14)
#define LED_RGB_BLUE_PIN _PINNUM(0, 15)
/*------------------------------------------------------------------*/
/* BUTTON

View File

@ -211,7 +211,7 @@ int main(void)
led_state(STATE_BOOTLOADER_STARTED);
if ( dfu_start || !valid_app || true)
if ( dfu_start || !valid_app )
{
if ( _ota_dfu )
{

View File

@ -1,7 +1,5 @@
#include "boards.h"
#define UF2_VERSION "1.00"
#ifndef PRODUCT_NAME
#define PRODUCT_NAME DIS_MODEL
#endif