separate feather and pca10056

This commit is contained in:
hathach 2018-06-26 15:30:07 +07:00
parent 3432182d2b
commit 0c96088b25
3 changed files with 26 additions and 30 deletions

View File

@ -267,12 +267,11 @@ all:
@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e clean
@echo Making feather52840 board
@echo ----------------------
@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e feather52840
#@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e clean
#@echo Making Metro52 board
#@echo --------------------
#@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e metro52
@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e feather52840
@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e clean
@echo Making pca10056 board
@echo --------------------
@$(MAKE) -s -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e pca10056
#target for printing all targets
help:
@ -310,10 +309,10 @@ feather52840: $(BUILD_DIRECTORIES) $(OBJECTS)
$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e finalize
# Target for Metro nrf52 board
metro52: OUTPUT_FILENAME := metro52_bootloader
metro52: FINAL_BIN_DIR := ../bin/metro52/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
metro52: CFLAGS += -DBOARD_METRO52
metro52: $(BUILD_DIRECTORIES) $(OBJECTS)
pca10056: OUTPUT_FILENAME := pca10056_bootloader
pca10056: FINAL_BIN_DIR := ../bin/pca10056/$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_REVISION)
pca10056: CFLAGS += -DBOARD_PCA10056
pca10056: $(BUILD_DIRECTORIES) $(OBJECTS)
@echo Linking target: $(OUTPUT_FILENAME).out
$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -lm -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e finalize
@ -370,8 +369,8 @@ flash_feather52840: feather52840
@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/$(BOOTLOADER_WITH_SD_NAME).hex
nrfjprog --program $(OUTPUT_BINARY_DIRECTORY)/$(BOOTLOADER_WITH_SD_NAME).hex -f nrf52 --chiperase --reset
flash_metro52: BOOTLOADER_WITH_SD_NAME := metro52_bootloader_$(BOOTLOADER_SD_SUFFIX)
flash_metro52: metro52
flash_pca10056: BOOTLOADER_WITH_SD_NAME := pca10056_bootloader_$(BOOTLOADER_SD_SUFFIX)
flash_pca10056: pca10056
@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/$(BOOTLOADER_WITH_SD_NAME).hex
nrfjprog --program $(OUTPUT_BINARY_DIRECTORY)/$(BOOTLOADER_WITH_SD_NAME).hex -f nrf52 --chiperase --reset

View File

@ -18,8 +18,8 @@
#if defined BOARD_FEATHER52840
#include "feather52840.h"
#elif defined BOARD_METRO52
#include "metro52.h"
#elif defined BOARD_PCA10056
#include "pca10056.h"
#else
#error No boards defined
#endif

View File

@ -34,38 +34,35 @@
*/
/**************************************************************************/
#ifndef METRO52_H
#define METRO52_H
// Note: FRST and LED2 are on the same pin, so can't be used together
// LED2 will be disabled since it is less critical
#ifndef PCA10056_H
#define PCA10056_H
/*------------------------------------------------------------------*/
/* LED
*------------------------------------------------------------------*/
#define LEDS_NUMBER 2
#define LED_1 29
#define LED_2 22
#define LED_STATE_ON 1
#define LED_1 13
#define LED_2 14
#define LED_STATE_ON 0
/*------------------------------------------------------------------*/
/* BUTTON
*------------------------------------------------------------------*/
#define BUTTONS_NUMBER 2
#define BUTTON_1 18
#define BUTTON_2 22
#define BUTTON_1 11
#define BUTTON_2 12
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
/*------------------------------------------------------------------*/
/* UART
*------------------------------------------------------------------*/
#define RX_PIN_NUMBER 23
#define TX_PIN_NUMBER 8
#define CTS_PIN_NUMBER 0
#define RTS_PIN_NUMBER 0
#define RX_PIN_NUMBER 8
#define TX_PIN_NUMBER 6
#define CTS_PIN_NUMBER 7
#define RTS_PIN_NUMBER 5
#define HWFC false
// Used as model string in OTA mode
#define DIS_MODEL "Bluefruit Metro 52"
#define DIS_MODEL "Nordic PCA10056"
#endif // METRO52_H
#endif // PCA10056_H