Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
dff8112ce9
17 files changed
+157
-136
No files matched your search
+13
-3
@@ -60,6 +60,7 @@ feather52832.menu.debug.l2=Level 2 (Full Debug)
|
||||
feather52832.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
feather52832.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
feather52832.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
feather52832.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
# ----------------------------------
|
||||
# Bluefruit Feather nRF52840 Express
|
||||
@@ -113,6 +114,7 @@ feather52840.menu.debug.l2=Level 2 (Full Debug)
|
||||
feather52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
feather52840.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
feather52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
feather52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
|
||||
# ----------------------------------
|
||||
@@ -167,6 +169,7 @@ feather52840sense.menu.debug.l2=Level 2 (Full Debug)
|
||||
feather52840sense.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
feather52840sense.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
feather52840sense.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
feather52840sense.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
|
||||
# ---------------------------------------------
|
||||
@@ -221,6 +224,7 @@ itsybitsy52840.menu.debug.l2=Level 2 (Full Debug)
|
||||
itsybitsy52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
itsybitsy52840.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
itsybitsy52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
itsybitsy52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
# ---------------------------------------------
|
||||
# Bluefruit Circuit Playground nRF52840 Express
|
||||
@@ -274,6 +278,7 @@ cplaynrf52840.menu.debug.l2=Level 2 (Full Debug)
|
||||
cplaynrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
cplaynrf52840.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
cplaynrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
cplaynrf52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
|
||||
# ---------------------------------------------
|
||||
@@ -298,7 +303,7 @@ cluenrf52840.upload.protocol=nrfutil
|
||||
cluenrf52840.upload.use_1200bps_touch=true
|
||||
cluenrf52840.upload.wait_for_upload_port=true
|
||||
cluenrf52840.upload.maximum_size=815104
|
||||
cluenrf52840.upload.maximum_data_size=248832
|
||||
cluenrf52840.upload.maximum_data_size=237568
|
||||
|
||||
# Build
|
||||
cluenrf52840.build.mcu=cortex-m4
|
||||
@@ -328,6 +333,7 @@ cluenrf52840.menu.debug.l2=Level 2 (Full Debug)
|
||||
cluenrf52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
cluenrf52840.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
cluenrf52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
cluenrf52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
# ----------------------------------
|
||||
# Bluefruit Metro nRF52840 Express
|
||||
@@ -381,6 +387,7 @@ metro52840.menu.debug.l2=Level 2 (Full Debug)
|
||||
metro52840.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
metro52840.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
metro52840.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
metro52840.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
|
||||
|
||||
@@ -434,6 +441,7 @@ pca10056.menu.debug.l2=Level 2 (Full Debug)
|
||||
pca10056.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
pca10056.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
pca10056.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
pca10056.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
# ----------------------------------
|
||||
# Particle Xenon
|
||||
@@ -457,7 +465,7 @@ particle_xenon.upload.protocol=nrfutil
|
||||
particle_xenon.upload.use_1200bps_touch=true
|
||||
particle_xenon.upload.wait_for_upload_port=true
|
||||
particle_xenon.upload.maximum_size=815104
|
||||
particle_xenon.upload.maximum_data_size=248832
|
||||
particle_xenon.upload.maximum_data_size=237568
|
||||
|
||||
# Build
|
||||
particle_xenon.build.mcu=cortex-m4
|
||||
@@ -487,6 +495,7 @@ particle_xenon.menu.debug.l2=Level 2 (Full Debug)
|
||||
particle_xenon.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
particle_xenon.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
particle_xenon.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
particle_xenon.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
|
||||
# ----------------------------------
|
||||
# Raytac MDBT50Q - RX
|
||||
@@ -510,7 +519,7 @@ mdbt50qrx.upload.protocol=nrfutil
|
||||
mdbt50qrx.upload.use_1200bps_touch=true
|
||||
mdbt50qrx.upload.wait_for_upload_port=true
|
||||
mdbt50qrx.upload.maximum_size=815104
|
||||
mdbt50qrx.upload.maximum_data_size=248832
|
||||
mdbt50qrx.upload.maximum_data_size=237568
|
||||
|
||||
# Build
|
||||
mdbt50qrx.build.mcu=cortex-m4
|
||||
@@ -540,3 +549,4 @@ mdbt50qrx.menu.debug.l2=Level 2 (Full Debug)
|
||||
mdbt50qrx.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
|
||||
mdbt50qrx.menu.debug.l3=Level 3 (Segger SystemView)
|
||||
mdbt50qrx.menu.debug.l3.build.debug_flags=-DCFG_DEBUG=3
|
||||
mdbt50qrx.menu.debug.l3.build.sysview_flags=-DCFG_SYSVIEW=1
|
||||
@@ -144,7 +144,7 @@ void detachInterrupt(uint32_t pin)
|
||||
|
||||
void GPIOTE_IRQHandler()
|
||||
{
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordEnterISR();
|
||||
#endif
|
||||
|
||||
@@ -171,7 +171,7 @@ void GPIOTE_IRQHandler()
|
||||
event = (uint32_t)((uint32_t)event + 4);
|
||||
}
|
||||
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordExitISR();
|
||||
#endif
|
||||
}
|
||||
@@ -116,6 +116,13 @@
|
||||
//--------------------------------------------------------------------+
|
||||
const char* dbg_err_str(int32_t err_id); // TODO move to other place
|
||||
|
||||
#if __cplusplus
|
||||
#define PRINTF ::printf
|
||||
#else
|
||||
#define PRINTF printf
|
||||
#endif
|
||||
|
||||
|
||||
#if CFG_DEBUG
|
||||
#define LOG_LV1(...) ADALOG(__VA_ARGS__)
|
||||
#define LOG_LV1_BUFFER(...) ADALOG_BUFFER(__VA_ARGS__)
|
||||
@@ -134,15 +141,9 @@ const char* dbg_err_str(int32_t err_id); // TODO move to other place
|
||||
|
||||
#if CFG_DEBUG
|
||||
|
||||
#if __cplusplus
|
||||
#define PRINTF ::printf
|
||||
#else
|
||||
#define PRINTF printf
|
||||
#endif
|
||||
|
||||
#define PRINT_LOCATION() PRINTF("%s: %d:\n", __PRETTY_FUNCTION__, __LINE__)
|
||||
#define PRINT_MESS(x) PRINTF("%s: %d: %s \n" , __FUNCTION__, __LINE__, (char*)(x))
|
||||
#define PRTNT_HEAP() if (CFG_DEBUG == 3) PRINTF("\n%s: %d: Heap free: %d\n", __FUNCTION__, __LINE__, util_heap_get_free_size())
|
||||
#define PRTNT_HEAP() if (CFG_DEBUG >= 3) PRINTF("\n%s: %d: Heap free: %d\n", __FUNCTION__, __LINE__, util_heap_get_free_size())
|
||||
#define PRINT_STR(x) PRINTF("%s: %d: " #x " = %s\n" , __FUNCTION__, __LINE__, (char*)(x) )
|
||||
#define PRINT_INT(x) PRINTF("%s: %d: " #x " = %ld\n" , __FUNCTION__, __LINE__, (uint32_t) (x) )
|
||||
#define PRINT_FLOAT(x) PRINTF("%s: %d: " #x " = %f\n" , __FUNCTION__, __LINE__, (float) (x) )
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "compiler_macro.h"
|
||||
#include "verify.h"
|
||||
#include "common_func.h"
|
||||
#include "verify.h"
|
||||
|
||||
#endif /* COMMON_INC_H_ */
|
||||
@@ -196,8 +196,8 @@ standard names - or at least those used in the unmodified vector table. */
|
||||
*/
|
||||
#define configUSE_DISABLE_TICK_AUTO_CORRECTION_DEBUG 0
|
||||
|
||||
// Sysview require at least debug level 3
|
||||
#if CFG_DEBUG >= 3
|
||||
// Sysview is enabled by default at debug level 3
|
||||
#if CFG_SYSVIEW
|
||||
#include "sysview/SEGGER_SYSVIEW_FreeRTOS.h"
|
||||
#endif
|
||||
|
||||
|
||||
+3
-3
@@ -24,8 +24,8 @@ void Bluefruit_printInfo() __attribute__((weak));
|
||||
void Bluefruit_printInfo() {}
|
||||
#endif
|
||||
|
||||
// DEBUG Level 3
|
||||
#if CFG_DEBUG >= 3
|
||||
// From the UI, setting debug level to 3 will enable SysView
|
||||
#if CFG_SYSVIEW
|
||||
#include "SEGGER_SYSVIEW.h"
|
||||
#endif
|
||||
|
||||
@@ -80,7 +80,7 @@ int main( void )
|
||||
Adafruit_TinyUSB_Core_init();
|
||||
#endif
|
||||
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_Conf();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ Purpose : Interface between FreeRTOS and SystemView.
|
||||
Revision: $Rev: 7947 $
|
||||
*/
|
||||
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
@@ -252,6 +252,6 @@ const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
|
||||
_cbSendTaskList,
|
||||
};
|
||||
|
||||
#endif // CFG_DEBUG >= 3
|
||||
#endif // CFG_SYSVIEW
|
||||
|
||||
/*************************** End of file ****************************/
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <malloc.h>
|
||||
#include <Arduino.h>
|
||||
#include <ctype.h>
|
||||
#include <common_func.h>
|
||||
|
||||
// defined in linker script
|
||||
extern uint32_t __data_start__[];
|
||||
@@ -106,14 +107,14 @@ static void printMemRegion(const char* name, uint32_t top, uint32_t bottom, uint
|
||||
sprintf(buffer, "%lu", top-bottom);
|
||||
}
|
||||
|
||||
printf("| %-5s| 0x%04X - 0x%04X | %-19s |\n", name, (uint16_t) bottom, (uint16_t) (top-1), buffer);
|
||||
PRINTF("| %-5s| 0x%04X - 0x%04X | %-19s |\n", name, (uint16_t) bottom, (uint16_t) (top-1), buffer);
|
||||
}
|
||||
|
||||
void dbgMemInfo(void)
|
||||
{
|
||||
printf(" ______________________________________________\n");
|
||||
printf("| Name | Addr 0x2000xxxx | Usage |\n");
|
||||
printf("| ---------------------------------------------|\n");
|
||||
PRINTF(" ______________________________________________\n");
|
||||
PRINTF("| Name | Addr 0x2000xxxx | Usage |\n");
|
||||
PRINTF("| ---------------------------------------------|\n");
|
||||
|
||||
// Pritn SRAM used for Stack executed by Softdevice and ISR
|
||||
printMemRegion("Stack", ((uint32_t) __StackTop), ((uint32_t) __StackLimit), dbgStackUsed() );
|
||||
@@ -127,8 +128,8 @@ void dbgMemInfo(void)
|
||||
// Print SRAM Used by SoftDevice
|
||||
printMemRegion("SD", (uint32_t) __data_start__, 0x20000000, 0);
|
||||
|
||||
printf("|______________________________________________|\n");
|
||||
printf("\n");
|
||||
PRINTF("|______________________________________________|\n");
|
||||
PRINTF("\n");
|
||||
|
||||
// Print Task list
|
||||
uint32_t tasknum = uxTaskGetNumberOfTasks();
|
||||
@@ -136,20 +137,20 @@ void dbgMemInfo(void)
|
||||
|
||||
vTaskList(buf);
|
||||
|
||||
printf("Task State Prio StackLeft Num\n");
|
||||
printf("-----------------------------------\n");
|
||||
printf(buf);
|
||||
printf("\n");
|
||||
PRINTF("Task State Prio StackLeft Num\n");
|
||||
PRINTF("-----------------------------------\n");
|
||||
PRINTF(buf);
|
||||
PRINTF("\n");
|
||||
rtos_free(buf);
|
||||
}
|
||||
|
||||
void dbgPrintVersion(void)
|
||||
{
|
||||
printf("\n");
|
||||
printf("BSP Library : " ARDUINO_BSP_VERSION "\n");
|
||||
printf("Bootloader : %s\n", getBootloaderVersion());
|
||||
printf("Serial No : %s\n", getMcuUniqueID());
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
PRINTF("BSP Library : " ARDUINO_BSP_VERSION "\n");
|
||||
PRINTF("Bootloader : %s\n", getBootloaderVersion());
|
||||
PRINTF("Serial No : %s\n", getMcuUniqueID());
|
||||
PRINTF("\n");
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
@@ -163,7 +164,7 @@ static void dump_str_line(uint8_t const* buf, uint16_t count)
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
const char ch = buf[i];
|
||||
printf("%c", isprint(ch) ? ch : '.');
|
||||
PRINTF("%c", isprint(ch) ? ch : '.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +172,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
|
||||
{
|
||||
if ( !buf || !count )
|
||||
{
|
||||
printf("NULL\n");
|
||||
PRINTF("NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,26 +192,26 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
|
||||
// Print Ascii
|
||||
if ( i != 0 )
|
||||
{
|
||||
printf(" | ");
|
||||
PRINTF(" | ");
|
||||
dump_str_line(buf8-16, 16);
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}
|
||||
|
||||
// print offset or absolute address
|
||||
if (printOffset)
|
||||
{
|
||||
printf("%03lX: ", 16*i/item_per_line);
|
||||
PRINTF("%03lX: ", 16*i/item_per_line);
|
||||
}else
|
||||
{
|
||||
printf("%08lX:", (uint32_t) buf8);
|
||||
PRINTF("%08lX:", (uint32_t) buf8);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&value, buf8, size);
|
||||
buf8 += size;
|
||||
|
||||
printf(" ");
|
||||
printf(format, value);
|
||||
PRINTF(" ");
|
||||
PRINTF(format, value);
|
||||
}
|
||||
|
||||
// fill up last row to 16 for printing ascii
|
||||
@@ -221,16 +222,16 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs
|
||||
{
|
||||
for(int i=0; i< 16-remain; i++)
|
||||
{
|
||||
printf(" ");
|
||||
for(int j=0; j<2*size; j++) printf(" ");
|
||||
PRINTF(" ");
|
||||
for(int j=0; j<2*size; j++) PRINTF(" ");
|
||||
}
|
||||
}
|
||||
|
||||
printf(" | ");
|
||||
PRINTF(" | ");
|
||||
dump_str_line(buf8-nback, nback);
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -238,11 +239,11 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count)
|
||||
{
|
||||
if ( !buf )
|
||||
{
|
||||
printf("NULL\n");
|
||||
PRINTF("NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
printf("%s = \n{\n ", str);
|
||||
PRINTF("%s = \n{\n ", str);
|
||||
|
||||
uint8_t const *buf8 = (uint8_t const *) buf;
|
||||
|
||||
@@ -250,17 +251,17 @@ void dbgDumpMemoryCFormat(const char* str, void const *buf, uint16_t count)
|
||||
{
|
||||
if ( i%16 == 0 )
|
||||
{
|
||||
if ( i != 0 ) printf(",\n ");
|
||||
if ( i != 0 ) PRINTF(",\n ");
|
||||
}else
|
||||
{
|
||||
if ( i != 0 ) printf(", ");
|
||||
if ( i != 0 ) PRINTF(", ");
|
||||
}
|
||||
|
||||
printf("0x%02X", *buf8);
|
||||
PRINTF("0x%02X", *buf8);
|
||||
buf8++;
|
||||
}
|
||||
|
||||
printf("\n};\n");
|
||||
PRINTF("\n};\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -60,16 +60,16 @@ extern "C"
|
||||
#define VERIFY_MESS(_status, _functstr) VERIFY_MESS_impl(_status, _functstr, __PRETTY_FUNCTION__, __LINE__)
|
||||
static inline void VERIFY_MESS_impl(int32_t _status, const char* (*_fstr)(int32_t), const char* func_name, int line_number)
|
||||
{
|
||||
printf("%s: %d: verify failed, error = ", func_name, line_number);
|
||||
PRINTF("%s: %d: verify failed, error = ", func_name, line_number);
|
||||
if (_fstr)
|
||||
{
|
||||
printf(_fstr(_status));
|
||||
PRINTF(_fstr(_status));
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%ld", _status);
|
||||
PRINTF("%ld", _status);
|
||||
}
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
}
|
||||
#else
|
||||
#define VERIFY_MESS(_status, _funcstr)
|
||||
|
||||
@@ -50,9 +50,10 @@ extern "C"
|
||||
*/
|
||||
void analogWriteResolution( uint8_t res )
|
||||
{
|
||||
HwPWM0.setResolution(res);
|
||||
HwPWM1.setResolution(res);
|
||||
HwPWM2.setResolution(res);
|
||||
for (int i = 0; i<HWPWM_MODULE_NUM; i++)
|
||||
{
|
||||
HwPWMx[i]->setResolution(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
#ifndef LFS_NO_MALLOC
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,9 @@ void BLEAdafruitQuaternion::_update_timer(int32_t ms)
|
||||
#if CFG_DEBUG
|
||||
static void print_quaternion(float quater[4])
|
||||
{
|
||||
Serial.printf("Quaternion: %.04f, %.04f, %.04f, %.04f\n", quater[0], quater[1], quater[2], quater[3]);
|
||||
// prepare for ability to change output, based on compile-time flags
|
||||
Print& logger = Serial;
|
||||
logger.printf("Quaternion: %.04f, %.04f, %.04f, %.04f\n", quater[0], quater[1], quater[2], quater[3]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -151,14 +151,16 @@ void BLEPeriph::_eventHandler(ble_evt_t* evt)
|
||||
void BLEPeriph::printInfo(void)
|
||||
{
|
||||
char const * title_fmt = "%-16s: ";
|
||||
// prepare for ability to change output, based on compile-time flags
|
||||
Print& logger = Serial;
|
||||
|
||||
Serial.printf(title_fmt, "Conn Intervals");
|
||||
Serial.printf("min = %.2f ms, ", _ppcp.min_conn_interval*1.25f);
|
||||
Serial.printf("max = %.2f ms", _ppcp.max_conn_interval*1.25f);
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "Conn Intervals");
|
||||
logger.printf("min = %.2f ms, ", _ppcp.min_conn_interval*1.25f);
|
||||
logger.printf("max = %.2f ms", _ppcp.max_conn_interval*1.25f);
|
||||
logger.println();
|
||||
|
||||
Serial.printf(title_fmt, "Conn Timeout");
|
||||
Serial.printf("%d ms", _ppcp.conn_sup_timeout*10);
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "Conn Timeout");
|
||||
logger.printf("%d ms", _ppcp.conn_sup_timeout*10);
|
||||
logger.println();
|
||||
}
|
||||
|
||||
@@ -971,120 +971,122 @@ void AdafruitBluefruit::printInfo(void)
|
||||
{
|
||||
// Skip if Serial is not initialised
|
||||
if ( !Serial ) return;
|
||||
// prepare for ability to change output, based on compile-time flags
|
||||
Print& logger = Serial;
|
||||
|
||||
// Skip if Bluefruit.begin() is not called
|
||||
if ( _ble_event_sem == NULL ) return;
|
||||
|
||||
Serial.println("--------- SoftDevice Config ---------");
|
||||
logger.println("--------- SoftDevice Config ---------");
|
||||
|
||||
char const * title_fmt = "%-16s: ";
|
||||
|
||||
/*------------- SoftDevice Config -------------*/
|
||||
// Max uuid128
|
||||
Serial.printf(title_fmt, "Max UUID128");
|
||||
Serial.println(_sd_cfg.uuid128_max);
|
||||
logger.printf(title_fmt, "Max UUID128");
|
||||
logger.println(_sd_cfg.uuid128_max);
|
||||
|
||||
// ATTR Table Size
|
||||
Serial.printf(title_fmt, "ATTR Table Size");
|
||||
Serial.println(_sd_cfg.attr_table_size);
|
||||
logger.printf(title_fmt, "ATTR Table Size");
|
||||
logger.println(_sd_cfg.attr_table_size);
|
||||
|
||||
// Service Changed
|
||||
Serial.printf(title_fmt, "Service Changed");
|
||||
Serial.println(_sd_cfg.service_changed);
|
||||
logger.printf(title_fmt, "Service Changed");
|
||||
logger.println(_sd_cfg.service_changed);
|
||||
|
||||
if ( _prph_count )
|
||||
{
|
||||
Serial.println("Peripheral Connect Setting");
|
||||
logger.println("Peripheral Connect Setting");
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "Max MTU");
|
||||
Serial.println(_sd_cfg.prph.mtu_max);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "Max MTU");
|
||||
logger.println(_sd_cfg.prph.mtu_max);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "Event Length");
|
||||
Serial.println(_sd_cfg.prph.event_len);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "Event Length");
|
||||
logger.println(_sd_cfg.prph.event_len);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "HVN Queue Size");
|
||||
Serial.println(_sd_cfg.prph.hvn_qsize);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "HVN Queue Size");
|
||||
logger.println(_sd_cfg.prph.hvn_qsize);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "WrCmd Queue Size");
|
||||
Serial.println(_sd_cfg.prph.wrcmd_qsize);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "WrCmd Queue Size");
|
||||
logger.println(_sd_cfg.prph.wrcmd_qsize);
|
||||
}
|
||||
|
||||
if ( _central_count )
|
||||
{
|
||||
Serial.println("Central Connect Setting");
|
||||
logger.println("Central Connect Setting");
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "Max MTU");
|
||||
Serial.println(_sd_cfg.central.mtu_max);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "Max MTU");
|
||||
logger.println(_sd_cfg.central.mtu_max);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "Event Length");
|
||||
Serial.println(_sd_cfg.central.event_len);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "Event Length");
|
||||
logger.println(_sd_cfg.central.event_len);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "HVN Queue Size");
|
||||
Serial.println(_sd_cfg.central.hvn_qsize);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "HVN Queue Size");
|
||||
logger.println(_sd_cfg.central.hvn_qsize);
|
||||
|
||||
Serial.print(" - ");
|
||||
Serial.printf(title_fmt, "WrCmd Queue Size");
|
||||
Serial.println(_sd_cfg.central.wrcmd_qsize);
|
||||
logger.print(" - ");
|
||||
logger.printf(title_fmt, "WrCmd Queue Size");
|
||||
logger.println(_sd_cfg.central.wrcmd_qsize);
|
||||
}
|
||||
|
||||
/*------------- Settings -------------*/
|
||||
Serial.println("\n--------- BLE Settings ---------");
|
||||
logger.println("\n--------- BLE Settings ---------");
|
||||
// Name
|
||||
Serial.printf(title_fmt, "Name");
|
||||
logger.printf(title_fmt, "Name");
|
||||
{
|
||||
char name[32];
|
||||
memclr(name, sizeof(name));
|
||||
getName(name, sizeof(name));
|
||||
Serial.printf(name);
|
||||
logger.printf(name);
|
||||
}
|
||||
Serial.println();
|
||||
logger.println();
|
||||
|
||||
// Max Connections
|
||||
Serial.printf(title_fmt, "Max Connections");
|
||||
Serial.printf("Peripheral = %d, ", _prph_count);
|
||||
Serial.printf("Central = %d ", _central_count);
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "Max Connections");
|
||||
logger.printf("Peripheral = %d, ", _prph_count);
|
||||
logger.printf("Central = %d ", _central_count);
|
||||
logger.println();
|
||||
|
||||
// Address
|
||||
Serial.printf(title_fmt, "Address");
|
||||
logger.printf(title_fmt, "Address");
|
||||
{
|
||||
char const * type_str[] = { "Public", "Static", "Private Resolvable", "Private Non Resolvable" };
|
||||
ble_gap_addr_t gap_addr = this->getAddr();
|
||||
|
||||
// MAC is in little endian --> print reverse
|
||||
Serial.printBufferReverse(gap_addr.addr, 6, ':');
|
||||
Serial.printf(" (%s)", type_str[gap_addr.addr_type]);
|
||||
logger.printBufferReverse(gap_addr.addr, 6, ':');
|
||||
logger.printf(" (%s)", type_str[gap_addr.addr_type]);
|
||||
}
|
||||
Serial.println();
|
||||
logger.println();
|
||||
|
||||
// Tx Power
|
||||
Serial.printf(title_fmt, "TX Power");
|
||||
Serial.printf("%d dBm", _tx_power);
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "TX Power");
|
||||
logger.printf("%d dBm", _tx_power);
|
||||
logger.println();
|
||||
|
||||
Periph.printInfo();
|
||||
|
||||
/*------------- List the paried device -------------*/
|
||||
if ( _prph_count )
|
||||
{
|
||||
Serial.printf(title_fmt, "Peripheral Paired Devices");
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "Peripheral Paired Devices");
|
||||
logger.println();
|
||||
bond_print_list(BLE_GAP_ROLE_PERIPH);
|
||||
}
|
||||
|
||||
if ( _central_count )
|
||||
{
|
||||
Serial.printf(title_fmt, "Central Paired Devices");
|
||||
Serial.println();
|
||||
logger.printf(title_fmt, "Central Paired Devices");
|
||||
logger.println();
|
||||
bond_print_list(BLE_GAP_ROLE_CENTRAL);
|
||||
}
|
||||
|
||||
Serial.println();
|
||||
logger.println();
|
||||
}
|
||||
@@ -250,14 +250,14 @@ void bond_print_list(uint8_t role)
|
||||
char devname[len];
|
||||
file.read(devname, len);
|
||||
|
||||
printf(" %s : %s (%lu bytes)\n", file.name(), devname, file.size());
|
||||
PRINTF(" %s : %s (%lu bytes)\n", file.name(), devname, file.size());
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
PRINTF("\n");
|
||||
|
||||
file.close();
|
||||
dir.close();
|
||||
|
||||
@@ -399,13 +399,13 @@ extern "C"
|
||||
{
|
||||
void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler(void)
|
||||
{
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordEnterISR();
|
||||
#endif
|
||||
|
||||
Wire.onService();
|
||||
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordExitISR();
|
||||
#endif
|
||||
}
|
||||
@@ -419,13 +419,13 @@ extern "C"
|
||||
{
|
||||
void SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler(void)
|
||||
{
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordEnterISR();
|
||||
#endif
|
||||
|
||||
Wire1.onService();
|
||||
|
||||
#if CFG_DEBUG >= 3
|
||||
#if CFG_SYSVIEW
|
||||
SEGGER_SYSVIEW_RecordExitISR();
|
||||
#endif
|
||||
}
|
||||
|
||||
+10
-6
@@ -51,13 +51,16 @@ compiler.size.cmd=arm-none-eabi-size
|
||||
# this can be overriden in boards.txt
|
||||
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float
|
||||
build.debug_flags=-DCFG_DEBUG=0
|
||||
build.logger_flags=-DCFG_LOGGER=1
|
||||
build.sysview_flags=-DCFG_SYSVIEW=0
|
||||
|
||||
# common compiler for nrf
|
||||
rtos.path={build.core.path}/freertos
|
||||
nordic.path={build.core.path}/nordic
|
||||
|
||||
|
||||
build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DLFS_NAME_MAX=64 -Ofast {build.debug_flags} "-I{build.core.path}/cmsis/include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/TinyUSB" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src"
|
||||
# build.logger_flags and build.sysview_flags and intentionally empty,
|
||||
# to allow modification via a user's own boards.local.txt or platform.local.txt files.
|
||||
build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DLFS_NAME_MAX=64 -Ofast {build.debug_flags} {build.logger_flags} {build.sysview_flags} "-I{build.core.path}/cmsis/include" "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{build.core.path}/TinyUSB" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore" "-I{build.core.path}/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src"
|
||||
|
||||
# usb flags
|
||||
build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
|
||||
@@ -76,10 +79,10 @@ compiler.elf2hex.extra_flags=
|
||||
# ----------------
|
||||
|
||||
## Compile c files
|
||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BSP_VERSION="{version}" {compiler.c.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
|
||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.c.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile c++ files
|
||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BSP_VERSION="{version}" {compiler.cpp.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
|
||||
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.cpp.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
|
||||
|
||||
## Compile S files
|
||||
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.flags.nrf} {includes} "{source_file}" -o "{object_file}"
|
||||
@@ -112,8 +115,8 @@ recipe.output.save_file_hexu={build.project_name}.save.hex
|
||||
|
||||
## Compute size
|
||||
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
|
||||
recipe.size.regex=\.text\s+([0-9]+).*
|
||||
recipe.size.regex.data=(\.data|\.bss|\.stack)\s+([0-9]+).*
|
||||
recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).*
|
||||
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
|
||||
|
||||
## Export Compiled Binary
|
||||
recipe.output.tmp_file={build.project_name}.hex
|
||||
@@ -147,3 +150,4 @@ tools.bootburn.bootloader.pattern={program.burn_pattern}
|
||||
tools.bootburn.erase.params.verbose=
|
||||
tools.bootburn.erase.params.quiet=
|
||||
tools.bootburn.erase.pattern=
|
||||
|
||||
Reference in new issue
Block a user