mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
sort files into src, example, and firmware
This commit is contained in:
parent
f61a6c2b1a
commit
55586b5121
@ -12,13 +12,25 @@ CC2564B = bluetooth_init_cc2564B_1.0_BT_Spec_4.1.o
|
||||
CC2567 = CC256x_BT_Service_Pack_2.8_ANT_1.16.o
|
||||
|
||||
BTSTACK_ROOT = ../..
|
||||
VPATH += example
|
||||
VPATH += firmware
|
||||
VPATH += src
|
||||
VPATH += $(BTSTACK_ROOT)/ble
|
||||
VPATH += $(BTSTACK_ROOT)/chipset-cc256x
|
||||
VPATH += $(BTSTACK_ROOT)/example/embedded
|
||||
VPATH += $(BTSTACK_ROOT)/src
|
||||
|
||||
CC = msp430-gcc
|
||||
CFLAGS = -mmcu=msp430f5438a -Os -Wall -fno-toplevel-reorder -I. -I$(BTSTACK_ROOT)/include -I$(BTSTACK_ROOT)/src -I$(BTSTACK_ROOT)/ble -I$(BTSTACK_ROOT)/chipset-cc256x
|
||||
CFLAGS = -mmcu=msp430f5438a -Os -Wall -fno-toplevel-reorder
|
||||
CFLAGS += \
|
||||
-I. \
|
||||
-I src \
|
||||
-I firmware \
|
||||
-I$(BTSTACK_ROOT)/include \
|
||||
-I$(BTSTACK_ROOT)/src \
|
||||
-I$(BTSTACK_ROOT)/ble \
|
||||
-I$(BTSTACK_ROOT)/chipset-cc256x \
|
||||
|
||||
LDFLAGS = -mmcu=msp430f5438a
|
||||
|
||||
CORE = \
|
||||
@ -133,9 +145,5 @@ clean:
|
||||
rm -f $ *.o *.out *.hex profile.h spp_and_le_counter.h ../driver/*.o ../../src/*.o ../src/*.o ../firmware/*.o ${BTSTACK_ROOT}/chipset-cc256x/*.o ${BTSTACK_ROOT}/src/*.o
|
||||
|
||||
size: all
|
||||
msp430-size ../firmware/*.o
|
||||
msp430-size ../src/*.o
|
||||
msp430-size ${BTSTACK_ROOT}/chipset-cc256x/*.o
|
||||
msp430-size ${BTSTACK_ROOT}/src/*.o
|
||||
msp430-size *.o
|
||||
msp430-size *.out
|
||||
|
@ -1,11 +0,0 @@
|
||||
PRIMARY_SERVICE, GAP_SERVICE
|
||||
CHARACTERISTIC, GAP_DEVICE_NAME, READ, "BTstack"
|
||||
CHARACTERISTIC, GAP_APPEARANCE, READ, 00 00
|
||||
|
||||
PRIMARY_SERVICE, GATT_SERVICE
|
||||
CHARACTERISTIC, GATT_SERVICE_CHANGED, READ,
|
||||
|
||||
PRIMARY_SERVICE, FFF0
|
||||
CHARACTERISTIC, FFF1, READ | WRITE | DYNAMIC,
|
||||
CHARACTERISTIC, FFF2, READ | WRITE | DYNAMIC,
|
||||
CHARACTERISTIC, 00001234-0000-1000-8000-00805F9B34FB, READ | WRITE | DYNAMIC,
|
76
platforms/msp-exp430f5438-cc2564b/src/main.c
Normal file
76
platforms/msp-exp430f5438-cc2564b/src/main.c
Normal file
@ -0,0 +1,76 @@
|
||||
// *****************************************************************************
|
||||
//
|
||||
// spp_counter demo - it provides an SPP and sends a counter every second
|
||||
//
|
||||
// it doesn't use the LCD to get down to a minimal memory footprint
|
||||
//
|
||||
// *****************************************************************************
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <msp430x54x.h>
|
||||
|
||||
#include "bt_control_cc256x.h"
|
||||
#include "hal_board.h"
|
||||
#include "hal_compat.h"
|
||||
#include "hal_usb.h"
|
||||
|
||||
#include <btstack/run_loop.h>
|
||||
|
||||
#include "hci.h"
|
||||
#include "btstack_memory.h"
|
||||
#include "remote_device_db.h"
|
||||
#include "btstack-config.h"
|
||||
|
||||
static void hw_setup(){
|
||||
// stop watchdog timer
|
||||
WDTCTL = WDTPW + WDTHOLD;
|
||||
|
||||
//Initialize clock and peripherals
|
||||
halBoardInit();
|
||||
halBoardStartXT1();
|
||||
halBoardSetSystemClock(SYSCLK_16MHZ);
|
||||
|
||||
// init debug UART
|
||||
halUsbInit();
|
||||
|
||||
// init LEDs
|
||||
LED_PORT_OUT |= LED_1 | LED_2;
|
||||
LED_PORT_DIR |= LED_1 | LED_2;
|
||||
|
||||
// ready - enable irq used in h4 task
|
||||
__enable_interrupt();
|
||||
}
|
||||
|
||||
static void btstack_setup(){
|
||||
/// GET STARTED with BTstack ///
|
||||
btstack_memory_init();
|
||||
run_loop_init(RUN_LOOP_EMBEDDED);
|
||||
|
||||
// init HCI
|
||||
hci_transport_t * transport = hci_transport_h4_dma_instance();
|
||||
bt_control_t * control = bt_control_cc256x_instance();
|
||||
hci_uart_config_t * config = hci_uart_config_cc256x_instance();
|
||||
remote_device_db_t * remote_db = (remote_device_db_t *) &remote_device_db_memory;
|
||||
hci_init(transport, config, control, remote_db);
|
||||
|
||||
// use eHCILL
|
||||
bt_control_cc256x_enable_ehcill(1);
|
||||
}
|
||||
|
||||
int btstack_main(int argc, const char * argv[]);
|
||||
|
||||
// main
|
||||
int main(void){
|
||||
|
||||
hw_setup();
|
||||
|
||||
btstack_setup();
|
||||
btstack_main(0, NULL);
|
||||
// happy compiler!
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user