Skip to content

Commit 7fb07e8

Browse files
nuttx: fix compilation with nuttx-10.2.0 and arm gcc9
Signed-off-by: Masayuki Ishikawa <[email protected]>
1 parent eba2980 commit 7fb07e8

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

Makefile

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@
3333
#
3434
############################################################################
3535

36-
-include $(TOPDIR)/Make.defs
36+
include $(APPDIR)/Make.defs
3737

3838
# Btstack_Demo, World! built-in application info
3939

40-
CONFIG_EXAMPLES_BTSTACK_PRIORITY ?= SCHED_PRIORITY_DEFAULT
40+
CONFIG_EXAMPLES_BTSTACK_PRIORITY ?= SCHED_PRIORITY_DEFAULT
4141
CONFIG_EXAMPLES_BTSTACK_STACKSIZE ?= 2048
4242

43-
APPNAME = btapp
43+
PROGNAME = panu_demo
4444
PRIORITY = $(CONFIG_EXAMPLES_BTSTACK_PRIORITY)
4545
STACKSIZE = $(CONFIG_EXAMPLES_BTSTACK_STACKSIZE)
46+
MODULE = $(CONFIG_EXAMPLES_BTSTACK)
4647

4748
#
4849

@@ -59,6 +60,7 @@ CFLAGS += -I${BTSTACK_ROOT}/platform/posix
5960
CFLAGS += -I${BTSTACK_ROOT}/platform/embedded
6061
CFLAGS += -I..
6162
CFLAGS += -DNUTTX -DCSR_ONLY -DCSR8811_PSKEYS
63+
CFLAGS += -Wno-format -Wno-undef -Wno-unused-function
6264

6365
ASRCS =
6466

@@ -88,7 +90,4 @@ CSRCS += ./example/panu_demo.c
8890

8991
MAINSRC = port/posix-h4/main.c
9092

91-
CONFIG_EXAMPLES_BTSTACK_PROGNAME ?= btapp$(EXEEXT)
92-
PROGNAME = $(CONFIG_EXAMPLES_BTSTACK_PROGNAME)
93-
9493
include $(APPDIR)/Application.mk

chipset/csr/btstack_chipset_csr.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
#include "btstack_util.h"
6363
#include "hci_transport.h"
6464

65-
#ifdef OK
66-
#undef OK
67-
#endif
68-
65+
#if 0
6966
enum update_result {
7067
OK,
7168
SKIP,
7269
};
70+
#else
71+
#define SKIP 1
72+
#endif
7373

7474
// minimal CSR init script to configure PSKEYs and activate them. It uses store 0x0008 = psram.
7575
static const uint8_t init_script[] = {
@@ -183,7 +183,7 @@ static void chipset_init(const void * config){
183183

184184
// set requested baud rate
185185
// @return 0 = OK, 1 = SKIP, 2 = ..
186-
static enum update_result update_init_script_command(uint8_t *hci_cmd_buffer){
186+
static int update_init_script_command(uint8_t *hci_cmd_buffer){
187187
uint16_t varid = little_endian_read_16(hci_cmd_buffer, 10);
188188
if (varid != 0x7003) return OK;
189189
uint16_t key = little_endian_read_16(hci_cmd_buffer, 14);
@@ -232,7 +232,7 @@ static btstack_chipset_result_t chipset_next_command(uint8_t * hci_cmd_buffer){
232232
memcpy(&hci_cmd_buffer[3], (uint8_t *) &init_script[init_script_offset], payload_len);
233233

234234
// support for on-the-fly configuration updates
235-
enum update_result res = update_init_script_command(hci_cmd_buffer);
235+
int res = update_init_script_command(hci_cmd_buffer);
236236
init_script_offset += payload_len;
237237

238238
// support for skipping commands

example/panu_demo.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,8 @@ static uint32_t sdp_bnep_remote_uuid = 0;
7070
static uint8_t attribute_value[1000];
7171
static const unsigned int attribute_value_buffer_size = sizeof(attribute_value);
7272

73-
// MBP 2016
74-
static const char * remote_addr_string = "F4-0F-24-3B-1B-E1";
75-
// Wiko Sunny static const char * remote_addr_string = "A0:4C:5B:0F:B2:42";
73+
// Android Phone
74+
static const char * remote_addr_string = "9C-5C-F9-0C-5C-15";
7675

7776
static bd_addr_t remote_addr;
7877

port/posix-h4/main.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ static int csr_off(void){
9797
return 0;
9898
}
9999

100-
static int csr_init(void){
101-
return 0;
100+
static void csr_init(const void *arg){
102101
}
103102

104103
static btstack_control_t hw_control = {
@@ -243,7 +242,7 @@ static void local_version_information_handler(uint8_t * packet){
243242
}
244243

245244
#ifdef NUTTX
246-
int btapp_main(int argc, const char * argv[]){
245+
int panu_demo_main(int argc, const char * argv[]){
247246
#else
248247
int main(int argc, const char * argv[]){
249248
#endif

0 commit comments

Comments
 (0)