mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
extracted spp_flowcontrol
This commit is contained in:
parent
32342b0d7c
commit
166c83b075
@ -4,8 +4,6 @@
|
||||
// Processing of data is simulated by granting the next
|
||||
// credit only every second in the heartbeat handler
|
||||
//
|
||||
// it doesn't use the LCD to get down to a minimal memory footprint
|
||||
//
|
||||
// *****************************************************************************
|
||||
|
||||
#include <stdint.h>
|
||||
@ -13,13 +11,6 @@
|
||||
#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/hci_cmds.h>
|
||||
#include <btstack/run_loop.h>
|
||||
#include <btstack/sdp_util.h>
|
||||
@ -27,7 +18,6 @@
|
||||
#include "hci.h"
|
||||
#include "l2cap.h"
|
||||
#include "btstack_memory.h"
|
||||
#include "remote_device_db.h"
|
||||
#include "rfcomm.h"
|
||||
#include "sdp.h"
|
||||
#include "btstack-config.h"
|
||||
@ -130,37 +120,8 @@ static void heartbeat_handler(struct timer *ts){
|
||||
run_loop_add_timer(ts);
|
||||
}
|
||||
|
||||
// main
|
||||
int main(void)
|
||||
{
|
||||
// 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;
|
||||
|
||||
/// 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[]);
|
||||
int btstack_main(int argc, const char * argv[]){
|
||||
|
||||
// init L2CAP
|
||||
l2cap_init();
|
||||
@ -185,12 +146,8 @@ int main(void)
|
||||
run_loop_set_timer(&heartbeat, HEARTBEAT_PERIOD_MS);
|
||||
run_loop_add_timer(&heartbeat);
|
||||
|
||||
|
||||
puts("SPP FlowControl Demo: simulates processing on received data...\n\r");
|
||||
|
||||
// ready - enable irq used in h4 task
|
||||
__enable_interrupt();
|
||||
|
||||
// turn on!
|
||||
hci_power_control(HCI_POWER_ON);
|
||||
|
@ -116,7 +116,7 @@ spp_and_le_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_
|
||||
spp_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} main.o spp_counter.o sdp.o hal_adc.o
|
||||
${CC} $^ ${LDFLAGS} -o $@
|
||||
|
||||
spp_flowcontrol.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_flowcontrol.o sdp.o hal_adc.o
|
||||
spp_flowcontrol.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} main.o spp_flowcontrol.o sdp.o hal_adc.o
|
||||
${CC} $^ ${LDFLAGS} -o $@
|
||||
|
||||
gap_inquiry.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} gap_inquiry.o hal_adc.o
|
||||
|
Loading…
x
Reference in New Issue
Block a user