Add board file deduction logic and board init stages
This commit is contained in:
parent
b861190cb8
commit
c7aaefb4da
@ -9,12 +9,15 @@ SDK_DEVICE_SOURCE := $(SDK_SOURCE)/ti/devices/$(SDK_DEVICE)
|
|||||||
SDK_DRIVERLIB := $(SDK_DEVICE_SOURCE)/driverlib
|
SDK_DRIVERLIB := $(SDK_DEVICE_SOURCE)/driverlib
|
||||||
SDK_DRIVERS := $(SDK_SOURCE)/ti/drivers
|
SDK_DRIVERS := $(SDK_SOURCE)/ti/drivers
|
||||||
SDK_KERNEL := $(SIMPLELINK_SDK)/kernel/nortos/
|
SDK_KERNEL := $(SIMPLELINK_SDK)/kernel/nortos/
|
||||||
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
|
||||||
SDK_STARTUP := $(SDK_DEVICE_SOURCE)/startup_files
|
SDK_STARTUP := $(SDK_DEVICE_SOURCE)/startup_files
|
||||||
SDK_STARTUP_SRCS = ccfg.c startup_gcc.c
|
SDK_STARTUP_SRCS = ccfg.c startup_gcc.c
|
||||||
|
|
||||||
EXTERNALDIRS += $(SDK_STARTUP)
|
EXTERNALDIRS += $(SDK_STARTUP)
|
||||||
|
|
||||||
|
ifneq ($(SIMPLELINK_BOARD),CUSTOM)
|
||||||
|
SDK_BOARDS := $(SDK_SOURCE)/ti/boards
|
||||||
|
LDSCRIPT = $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD)_NoRTOS.lds
|
||||||
|
endif
|
||||||
|
|
||||||
### MODULES will add some of these to the include path, but we need to add
|
### MODULES will add some of these to the include path, but we need to add
|
||||||
### them earlier to prevent filename clashes with Contiki core files
|
### them earlier to prevent filename clashes with Contiki core files
|
||||||
CFLAGS += -I$(CPU_ABS_PATH)
|
CFLAGS += -I$(CPU_ABS_PATH)
|
||||||
@ -24,7 +27,10 @@ CFLAGS += -I$(SDK_DEVICE_SOURCE)/inc
|
|||||||
CFLAGS += -I$(SDK_KERNEL)
|
CFLAGS += -I$(SDK_KERNEL)
|
||||||
CFLAGS += -I$(SDK_KERNEL)/posix
|
CFLAGS += -I$(SDK_KERNEL)/posix
|
||||||
|
|
||||||
LDSCRIPT = $(SDK_BOARDS)/$(SIMPLELINK_BOARD)/$(SIMPLELINK_BOARD)_NoRTOS.lds
|
ifneq ($(SIMPLELINK_BOARD),CUSTOM)
|
||||||
|
CFLAGS += -I$(SDK_BOARDS)/$(SIMPLELINK_BOARD)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
### If the user-specified a Node ID, pass a define
|
### If the user-specified a Node ID, pass a define
|
||||||
ifdef NODEID
|
ifdef NODEID
|
||||||
|
@ -8,6 +8,17 @@ ifndef SIMPLELINK_SDK
|
|||||||
$(error SIMPLELINK_SDK not defined! You must specify where the SimpleLink SDK resides!)
|
$(error SIMPLELINK_SDK not defined! You must specify where the SimpleLink SDK resides!)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
AVAILABLE_BOARDS := $(shell ls $(SIMPLELINK_SDK)/source/ti/boards/)
|
||||||
|
AVAILABLE_BOARDS += CUSTOM # Allows an own board file in the application project
|
||||||
|
|
||||||
|
ifndef SIMPLELINK_BOARD
|
||||||
|
$(error SIMPLELINK_BOARD not defined! You must specify a board! Available boards: $(AVAILABLE_BOARDS))
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring $(SIMPLELINK_BOARD),$(AVAILABLE_BOARDS)),$(SIMPLELINK_BOARD))
|
||||||
|
$(error '$(SIMPLELINK_BOARD)' is not a valid board. Available boards: $(AVAILABLE_BOARDS))
|
||||||
|
endif
|
||||||
|
|
||||||
### Board and BSP selection
|
### Board and BSP selection
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS += .
|
CONTIKI_TARGET_DIRS += .
|
||||||
|
@ -46,6 +46,12 @@
|
|||||||
*/
|
*/
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
|
|
||||||
|
#include <Board.h>
|
||||||
|
#include <ti/drivers/GPIO.h>
|
||||||
|
#include <ti/drivers/Power.h>
|
||||||
|
|
||||||
|
|
||||||
//#include "leds.h"
|
//#include "leds.h"
|
||||||
//#include "lpm.h"
|
//#include "lpm.h"
|
||||||
//#include "gpio-interrupt.h"
|
//#include "gpio-interrupt.h"
|
||||||
@ -123,6 +129,10 @@ void board_init(void);
|
|||||||
void
|
void
|
||||||
platform_init_stage_one()
|
platform_init_stage_one()
|
||||||
{
|
{
|
||||||
|
Board_initGeneral();
|
||||||
|
GPIO_init();
|
||||||
|
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
|
||||||
|
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_OFF);
|
||||||
// /* Enable flash cache and prefetch. */
|
// /* Enable flash cache and prefetch. */
|
||||||
// ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
|
// ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
|
||||||
// ti_lib_vims_configure(VIMS_BASE, true, true);
|
// ti_lib_vims_configure(VIMS_BASE, true, true);
|
||||||
@ -158,6 +168,9 @@ platform_init_stage_one()
|
|||||||
void
|
void
|
||||||
platform_init_stage_two()
|
platform_init_stage_two()
|
||||||
{
|
{
|
||||||
|
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_OFF);
|
||||||
|
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON);
|
||||||
|
|
||||||
// random_init(0x1234);
|
// random_init(0x1234);
|
||||||
//
|
//
|
||||||
// /* Character I/O Initialisation */
|
// /* Character I/O Initialisation */
|
||||||
@ -176,6 +189,9 @@ platform_init_stage_two()
|
|||||||
void
|
void
|
||||||
platform_init_stage_three()
|
platform_init_stage_three()
|
||||||
{
|
{
|
||||||
|
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
|
||||||
|
GPIO_write(Board_GPIO_LED1, Board_GPIO_LED_ON);
|
||||||
|
|
||||||
// radio_value_t chan, pan;
|
// radio_value_t chan, pan;
|
||||||
//
|
//
|
||||||
// set_rf_params();
|
// set_rf_params();
|
||||||
|
Loading…
Reference in New Issue
Block a user