Skip to content

Commit c88bd00

Browse files
committed
Merge branch 'master' into develop
2 parents 8d3c40c + 69f1802 commit c88bd00

File tree

21 files changed

+272
-152
lines changed

21 files changed

+272
-152
lines changed

boards.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ feather52832.upload.native_usb=false
3535
# Build
3636
feather52832.build.mcu=cortex-m4
3737
feather52832.build.f_cpu=64000000
38-
feather52832.build.board=NRF52_FEATHER
38+
feather52832.build.board=NRF52832_FEATHER
3939
feather52832.build.core=nRF5
4040
feather52832.build.variant=feather_nrf52832
41-
feather52832.build.extra_flags=-DNRF52832_XXAA -DNRF52
41+
feather52832.build.extra_flags=-DNRF52832_XXAA -DNRF52 -DARDUINO_NRF52_FEATHER
4242

4343
# SofDevice Menu
4444
# Ram & ROM size varies depending on SoftDevice (check linker script)
@@ -98,7 +98,7 @@ feather52840.build.f_cpu=64000000
9898
feather52840.build.board=NRF52840_FEATHER
9999
feather52840.build.core=nRF5
100100
feather52840.build.variant=feather_nrf52840_express
101-
feather52840.build.extra_flags=-DNRF52840_XXAA
101+
feather52840.build.extra_flags=-DNRF52840_XXAA -DARDUINO_NRF52_FEATHER
102102

103103
# SofDevice Menu
104104
# Ram & ROM size varies depending on SoftDevice (check linker script)

cores/nRF5/WInterrupts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
8686
break;
8787

8888
default:
89-
return;
89+
return 0;
9090
}
9191

9292
for (int ch = 0; ch < NUMBER_OF_GPIO_TE; ch++) {

cores/nRF5/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ int _write (int fd, const void *buf, size_t count)
114114

115115
if ( Serial )
116116
{
117-
Serial.write( (const uint8_t *) buf, count);
117+
return Serial.write( (const uint8_t *) buf, count);
118118
}
119+
return 0;
119120
}
120121

121122
}

cores/nRF5/utility/AdaCallback.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,18 @@
3838

3939
#include "common_inc.h"
4040

41+
#ifndef CFG_CALLBACK_TASK_STACKSIZE
4142
#define CFG_CALLBACK_TASK_STACKSIZE (512*2)
43+
#endif
44+
45+
#ifndef CFG_CALLBACK_QUEUE_LENGTH
4246
#define CFG_CALLBACK_QUEUE_LENGTH 20
47+
#endif
48+
49+
#ifndef CFG_CALLBACK_TIMEOUT
4350
#define CFG_CALLBACK_TIMEOUT 100
51+
#endif
52+
4453

4554
#ifdef __cplusplus
4655
extern "C"{

libraries/Bluefruit52Lib/examples/Hardware/SerialEcho/SerialEcho.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const int baudrate = 115200;
2424
void setup()
2525
{
2626
Serial.begin (baudrate);
27+
while ( !Serial ) delay(10); // for nrf52840 with native usb
2728

2829
Serial.println("Serial Echo demo");
2930
Serial.print("Badurate : ");

libraries/Bluefruit52Lib/examples/Hardware/digital_interrupt_deferred/digital_interrupt_deferred.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ int interruptPin = A0;
2323
void setup()
2424
{
2525
Serial.begin(115200);
26+
while ( !Serial ) delay(10); // for nrf52840 with native usb
2627

2728
pinMode(interruptPin, INPUT_PULLUP);
2829

libraries/Bluefruit52Lib/examples/Peripheral/hid_keyscan/hid_keyscan.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include <bluefruit.h>
2121

22+
BLEDis bledis;
2223
BLEHidAdafruit blehid;
2324

2425
// Array of pins and its keycode
@@ -56,6 +57,11 @@ void setup()
5657
Bluefruit.setTxPower(4);
5758
Bluefruit.setName("Bluefruit52");
5859

60+
// Configure and Start Device Information Service
61+
bledis.setManufacturer("Adafruit Industries");
62+
bledis.setModel("Bluefruit Feather 52");
63+
bledis.begin();
64+
5965
// set up pin as input
6066
for (uint8_t i=0; i<pincount; i++)
6167
{

libraries/Bluefruit52Lib/src/BLECharacteristic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ uint16_t BLECharacteristic::read16(void)
596596

597597
uint32_t BLECharacteristic::read32(void)
598598
{
599-
uint16_t num;
599+
uint32_t num;
600600
return read(&num, sizeof(num)) ? num : 0;
601601
}
602602

libraries/Bluefruit52Lib/src/bluefruit.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@
4242
#include "usb/usb.h"
4343
#endif
4444

45+
#ifndef CFG_BLE_TX_POWER_LEVEL
4546
#define CFG_BLE_TX_POWER_LEVEL 0
47+
#endif
48+
49+
#ifndef CFG_DEFAULT_NAME
4650
#define CFG_DEFAULT_NAME "Bluefruit52"
51+
#endif
52+
4753

54+
#ifndef CFG_BLE_TASK_STACKSIZE
4855
#define CFG_BLE_TASK_STACKSIZE (512*3)
56+
#endif
57+
58+
#ifndef CFG_SOC_TASK_STACKSIZE
4959
#define CFG_SOC_TASK_STACKSIZE (200)
60+
#endif
61+
5062

5163
AdafruitBluefruit Bluefruit;
5264

libraries/Bluefruit52Lib/src/clients/BLEClientHidAdafruit.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ bool BLEClientHidAdafruit::begin(void)
8181
// set notify callback
8282
_kbd_boot_input.setNotifyCallback(kbd_client_notify_cb);
8383
_mse_boot_input.setNotifyCallback(mse_client_notify_cb);
84+
85+
return true;
8486
}
8587

8688
void BLEClientHidAdafruit::setKeyboardReportCallback(kbd_callback_t fp)
@@ -140,12 +142,12 @@ bool BLEClientHidAdafruit::keyboardPresent(void)
140142

141143
bool BLEClientHidAdafruit::enableKeyboard(void)
142144
{
143-
_kbd_boot_input.enableNotify();
145+
return _kbd_boot_input.enableNotify();
144146
}
145147

146148
bool BLEClientHidAdafruit::disableKeyboard(void)
147149
{
148-
_kbd_boot_input.disableNotify();
150+
return _kbd_boot_input.disableNotify();
149151
}
150152

151153
void BLEClientHidAdafruit::_handle_kbd_input(uint8_t* data, uint16_t len)
@@ -171,12 +173,12 @@ bool BLEClientHidAdafruit::mousePresent(void)
171173

172174
bool BLEClientHidAdafruit::enableMouse(void)
173175
{
174-
_mse_boot_input.enableNotify();
176+
return _mse_boot_input.enableNotify();
175177
}
176178

177179
bool BLEClientHidAdafruit::disableMouse(void)
178180
{
179-
_mse_boot_input.disableNotify();
181+
return _mse_boot_input.disableNotify();
180182
}
181183

182184
void BLEClientHidAdafruit::_handle_mse_input(uint8_t* data, uint16_t len)

0 commit comments

Comments
 (0)