Skip to content

Commit d70e86b

Browse files
authored
Merge branch 'master' into develop
2 parents e16f80b + 6b41c19 commit d70e86b

File tree

19 files changed

+111
-217
lines changed

19 files changed

+111
-217
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,20 @@ assignees: ''
1010
**Describe the bug**
1111
A clear and concise description of what the bug is.
1212

13-
**Set up (please complete the following information)**
14-
- Your Board and BSP version
15-
- Your OS (mac/windows/linux) and its version
16-
- Serial debug log (enable IDE's Debug Mode Level to 1 or 2)
13+
**Set up (mandatory)**
14+
- **PC & IDE** : Arduino 1.8.13 on Ubuntu 18.04 / Windows 10/ macOS 10.15
15+
- **BSP** : 0.20.0
16+
- **Board** : Feather nRF52840 Express
17+
- **Sketch**: Bluefruit52Lib/examples/Peripheral/bleuart. If it is a custom sketch, please provide a minimal sketch within codeblock
1718

1819
**To Reproduce**
1920
Steps to reproduce the behavior:
2021
1. Go to '...'
2122
2. Click on '....'
22-
3. Scroll down to '....'
23-
4. See error
24-
25-
**Expected behavior**
26-
A clear and concise description of what you expected to happen.
23+
3. See error
2724

2825
**Screenshots**
2926
If applicable, add screenshots to help explain your problem.
3027

31-
**Additional context**
32-
Add any other context about the problem here.
28+
**Serial Log**
29+
Serial output when IDE's Debug Mode Level to 1 or 2

.github/workflows/githubci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,24 @@ jobs:
4747
arduino-cli core update-index
4848
arduino-cli core update-index --additional-urls $BSP_URL
4949
arduino-cli core install adafruit:nrf52 --additional-urls $BSP_URL
50+
5051
# Repalce release BSP with our code
5152
BSP_VERSION=`eval ls $HOME/$BSP_PATH`
5253
rm -r $HOME/$BSP_PATH/*
5354
ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION
55+
5456
# Install library dependency
55-
arduino-cli lib install "Adafruit AHRS" "Adafruit APDS9960 Library" "Adafruit BMP280 Library" "Adafruit Circuit Playground" "Adafruit EPD" "Adafruit GFX Library" "Adafruit HX8357 Library" "Adafruit ILI9341" "Adafruit LIS3MDL" "Adafruit LSM6DS" "Adafruit NeoPixel" "Adafruit NeoMatrix" "Adafruit nRFCrypto" "Adafruit Sensor Calibration" "Adafruit SHT31 Library" "Adafruit SSD1306" "Adafruit ST7735 and ST7789 Library" "Firmata" "SdFat - Adafruit Fork"
57+
arduino-cli lib install "Adafruit AHRS" "Adafruit APDS9960 Library" "Adafruit BMP280 Library" "Adafruit Circuit Playground" "Adafruit EPD" "Adafruit GFX Library" "Adafruit HX8357 Library" "Adafruit ILI9341" "Adafruit LIS3MDL" "Adafruit LSM6DS" "Adafruit NeoPixel" "Adafruit NeoMatrix" "Adafruit nRFCrypto" "Adafruit Sensor Calibration" "Adafruit SHT31 Library" "Adafruit SSD1306" "Adafruit ST7735 and ST7789 Library" "SdFat - Adafruit Fork"
5658
5759
# TODO update to support MIDI version 5 later on
5860
arduino-cli lib install "MIDI Library"@4.3.1
5961
62+
# TODO use firmata master to prevent build error with gcc v9 (should be remove after 2.5.9 is released)
63+
# https://github.com/firmata/arduino/pull/438
64+
git clone --depth 1 https://github.com/firmata/arduino.git $HOME/Arduino/libraries/firmata
65+
66+
# Library summary
67+
arduino-cli lib list
68+
6069
- name: Build examples
6170
run: python3 tools/build_all.py ${{ matrix.arduino-platform }}

cores/nRF5/TinyUSB/Adafruit_TinyUSB_nRF.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
#include "Arduino.h"
3131
#include "Adafruit_TinyUSB_Core.h"
3232

33+
//--------------------------------------------------------------------+
34+
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
35+
//--------------------------------------------------------------------+
36+
37+
#define USBD_STACK_SZ (200)
38+
39+
// tinyusb function that handles power event (detected, ready, removed)
40+
// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
41+
extern "C" void tusb_hal_nrf_power_event(uint32_t event);
42+
3343
//--------------------------------------------------------------------+
3444
// Forward USB interrupt events to TinyUSB IRQ Handler
3545
//--------------------------------------------------------------------+
@@ -42,34 +52,10 @@ extern "C" void USBD_IRQHandler(void)
4252
tud_int_handler(0);
4353

4454
#if CFG_SYSVIEW
45-
SEGGER_SYSVIEW_RecordExitISR();
55+
SEGGER_SYSVIEW_RecordExitISR();
4656
#endif
4757
}
4858

49-
//--------------------------------------------------------------------+
50-
// MACRO TYPEDEF CONSTANT ENUM DECLARATION
51-
//--------------------------------------------------------------------+
52-
53-
#define USBD_STACK_SZ (200)
54-
55-
// tinyusb function that handles power event (detected, ready, removed)
56-
// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
57-
extern "C" void tusb_hal_nrf_power_event(uint32_t event);
58-
59-
// USB Device Driver task
60-
// This top level thread process all usb events and invoke callbacks
61-
static void usb_device_task(void* param)
62-
{
63-
(void) param;
64-
65-
// RTOS forever loop
66-
while (1)
67-
{
68-
// tinyusb device task
69-
tud_task();
70-
}
71-
}
72-
7359
//--------------------------------------------------------------------+
7460
// Core Init & Touch1200
7561
//--------------------------------------------------------------------+
@@ -99,8 +85,12 @@ static void usb_hardware_init(void)
9985
if ( usb_reg & POWER_USBREGSTATUS_OUTPUTRDY_Msk ) tusb_hal_nrf_power_event(NRFX_POWER_USB_EVT_READY);
10086
}
10187

102-
void Adafruit_TinyUSB_Core_init(void)
88+
// USB Device Driver task
89+
// This top level thread process all usb events and invoke callbacks
90+
static void usb_device_task(void* param)
10391
{
92+
(void) param;
93+
10494
USBDevice.addInterface( (Adafruit_USBD_Interface&) Serial);
10595
USBDevice.setID(USB_VID, USB_PID);
10696
USBDevice.begin();
@@ -110,6 +100,16 @@ void Adafruit_TinyUSB_Core_init(void)
110100
// Init tinyusb stack
111101
tusb_init();
112102

103+
// RTOS forever loop
104+
while (1)
105+
{
106+
// tinyusb device task
107+
tud_task();
108+
}
109+
}
110+
111+
void Adafruit_TinyUSB_Core_init(void)
112+
{
113113
// Create a task for tinyusb device stack
114114
xTaskCreate( usb_device_task, "usbd", USBD_STACK_SZ, NULL, TASK_PRIO_HIGH, NULL);
115115
}

cores/nRF5/avr/pgmspace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef const void* uint_farptr_t;
102102
#define pgm_read_word(addr) (*(const unsigned short *)(addr))
103103
#define pgm_read_dword(addr) (*(const unsigned long *)(addr))
104104
#define pgm_read_float(addr) (*(const float *)(addr))
105-
#define pgm_read_ptr(addr) (*(const void *)(addr))
105+
#define pgm_read_ptr(addr) (*(const void* *)(addr))
106106

107107
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
108108
#define pgm_read_word_near(addr) pgm_read_word(addr)

cores/nRF5/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ int main( void )
7272
init();
7373
initVariant();
7474

75-
#ifdef USE_TINYUSB
76-
Adafruit_TinyUSB_Core_init();
77-
#endif
78-
7975
#if CFG_SYSVIEW
8076
SEGGER_SYSVIEW_Conf();
8177
#endif
8278

79+
#ifdef USE_TINYUSB
80+
Adafruit_TinyUSB_Core_init();
81+
#endif
82+
8383
// Create a task for loop()
8484
xTaskCreate( loop_task, "loop", LOOP_STACK_SZ, NULL, TASK_PRIO_LOW, &_loopHandle);
8585

libraries/BLEAdafruitService/src/services/BLEAdafruitSensor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ BLEAdafruitSensor::BLEAdafruitSensor(BLEUuid service_uuid, BLEUuid data_uuid)
3636
_notify_cb = NULL;
3737
}
3838

39-
err_t BLEAdafruitSensor::_begin(int32_t ms)
39+
err_t BLEAdafruitSensor::_begin(int ms)
4040
{
4141
// Invoke base class begin()
4242
VERIFY_STATUS( BLEService::begin() );
@@ -59,19 +59,19 @@ err_t BLEAdafruitSensor::_begin(int32_t ms)
5959
return ERROR_NONE;
6060
}
6161

62-
err_t BLEAdafruitSensor::begin(measure_callback_t fp, int32_t ms)
62+
err_t BLEAdafruitSensor::begin(measure_callback_t fp, int ms)
6363
{
6464
_measure_cb = fp;
6565
return _begin(ms);
6666
}
6767

68-
err_t BLEAdafruitSensor::begin(Adafruit_Sensor* sensor, int32_t ms)
68+
err_t BLEAdafruitSensor::begin(Adafruit_Sensor* sensor, int ms)
6969
{
7070
_sensor = sensor;
7171
return _begin(ms);
7272
}
7373

74-
void BLEAdafruitSensor::setPeriod(int32_t period_ms)
74+
void BLEAdafruitSensor::setPeriod(int period_ms)
7575
{
7676
_period.write32(period_ms);
7777
_update_timer(period_ms);

libraries/BLEAdafruitService/src/services/BLEAdafruitSensor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
class BLEAdafruitSensor : public BLEService
3131
{
3232
public:
33-
static const int32_t DEFAULT_PERIOD = 1000;
33+
static const int DEFAULT_PERIOD = 1000;
3434

3535
typedef void (*notify_callback_t)(uint16_t conn_hdl, bool enabled);
3636
typedef uint16_t (*measure_callback_t )(uint8_t* buf, uint16_t bufsize);
3737

3838
BLEAdafruitSensor(BLEUuid service_uuid, BLEUuid data_uuid);
3939

40-
virtual err_t begin(measure_callback_t fp, int32_t ms = DEFAULT_PERIOD);
41-
virtual err_t begin(Adafruit_Sensor* sensor, int32_t ms = DEFAULT_PERIOD);
40+
virtual err_t begin(measure_callback_t fp, int ms = DEFAULT_PERIOD);
41+
virtual err_t begin(Adafruit_Sensor* sensor, int ms = DEFAULT_PERIOD);
4242

43-
void setPeriod(int32_t period_ms);
43+
void setPeriod(int period_ms);
4444
void setNotifyCallback(notify_callback_t fp);
4545

4646
protected:
@@ -54,7 +54,7 @@ class BLEAdafruitSensor : public BLEService
5454

5555
SoftwareTimer _timer;
5656

57-
err_t _begin(int32_t ms);
57+
err_t _begin(int ms);
5858

5959
virtual void _update_timer(int32_t ms);
6060
virtual void _measure_handler(void);

libraries/Bluefruit52Lib/src/BLECharacteristic.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,6 @@ uint16_t BLECharacteristic::write32(int num)
588588
return write32( (uint32_t) num );
589589
}
590590

591-
uint16_t BLECharacteristic::write32(int32_t num)
592-
{
593-
return write32( (uint32_t) num );
594-
}
595-
596591
/*------------------------------------------------------------------*/
597592
/* READ
598593
*------------------------------------------------------------------*/

libraries/Bluefruit52Lib/src/BLECharacteristic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class BLECharacteristic
112112
uint16_t write16 (uint16_t num);
113113
uint16_t write32 (uint32_t num);
114114
uint16_t write32 (int num);
115-
uint16_t write32 (int32_t num);
116115

117116
/*------------- Read -------------*/
118117
uint16_t read (void* buffer, uint16_t bufsize, uint16_t offset = 0);

0 commit comments

Comments
 (0)