Skip to content

Commit 16fb459

Browse files
authored
Merge pull request #658 from adafruit/motion-trainer
Port TensorFlow Lite Motion Kit project
2 parents e9d1ab7 + 556f36d commit 16fb459

File tree

47 files changed

+1889
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1889
-101
lines changed

cores/nRF5/common_func.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const char* dbg_err_str(int32_t err_id); // TODO move to other place
184184
#define PRINT_HEX(x) \
185185
do {\
186186
PRINTF("%s: %d: " #x " = 0x", __PRETTY_FUNCTION__, __LINE__);\
187-
char fmt[] = "%00X\n";\
187+
char fmt[] = "%00X\r\n";\
188188
fmt[2] += 2*sizeof(x); /* Hex with correct size */\
189189
PRINTF(fmt, (x) );\
190190
}while(0)
@@ -197,14 +197,14 @@ const char* dbg_err_str(int32_t err_id); // TODO move to other place
197197
if (i%16 == 0) PRINTF("\n"); \
198198
PRINTF("%02x ", p8[i]); \
199199
}\
200-
PRINTF("\n");\
200+
PRINTF("\r\n");\
201201
}while(0)
202202

203203
#define ADALOG(tag, ...) \
204204
do { \
205205
if ( tag ) PRINTF("[%-6s] ", tag);\
206206
PRINTF(__VA_ARGS__);\
207-
PRINTF("\n");\
207+
PRINTF("\r\n");\
208208
}while(0)
209209

210210
#define ADALOG_BUFFER(_tag, _buf, _n) \

cores/nRF5/utility/debug.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ static void printMemRegion(const char* name, uint32_t top, uint32_t bottom, uint
107107
sprintf(buffer, "%lu", top-bottom);
108108
}
109109

110-
PRINTF("| %-5s| 0x%04X - 0x%04X | %-19s |\n", name, (uint16_t) bottom, (uint16_t) (top-1), buffer);
110+
PRINTF("| %-5s| 0x%04X - 0x%04X | %-19s |\r\n", name, (uint16_t) bottom, (uint16_t) (top-1), buffer);
111111
}
112112

113113
void dbgMemInfo(void)
114114
{
115-
PRINTF(" ______________________________________________\n");
116-
PRINTF("| Name | Addr 0x2000xxxx | Usage |\n");
117-
PRINTF("| ---------------------------------------------|\n");
115+
PRINTF(" ______________________________________________\r\n");
116+
PRINTF("| Name | Addr 0x2000xxxx | Usage |\r\n");
117+
PRINTF("| ---------------------------------------------|\r\n");
118118

119119
// Pritn SRAM used for Stack executed by Softdevice and ISR
120120
printMemRegion("Stack", ((uint32_t) __StackTop), ((uint32_t) __StackLimit), dbgStackUsed() );
@@ -128,7 +128,7 @@ void dbgMemInfo(void)
128128
// Print SRAM Used by SoftDevice
129129
printMemRegion("SD", (uint32_t) __data_start__, 0x20000000, 0);
130130

131-
PRINTF("|______________________________________________|\n");
131+
PRINTF("|______________________________________________|\r\n");
132132
PRINTF("\n");
133133

134134
// Print Task list
@@ -137,20 +137,20 @@ void dbgMemInfo(void)
137137

138138
vTaskList(buf);
139139

140-
PRINTF("Task State Prio StackLeft Num\n");
141-
PRINTF("-----------------------------------\n");
140+
PRINTF("Task State Prio StackLeft Num\r\n");
141+
PRINTF("-----------------------------------\r\n");
142142
PRINTF(buf);
143143
PRINTF("\n");
144144
rtos_free(buf);
145145
}
146146

147147
void dbgPrintVersion(void)
148148
{
149-
PRINTF("\n");
150-
PRINTF("BSP Library : " ARDUINO_BSP_VERSION "\n");
151-
PRINTF("Bootloader : %s\n", getBootloaderVersion());
152-
PRINTF("Serial No : %s\n", getMcuUniqueID());
153-
PRINTF("\n");
149+
PRINTF("\r\n");
150+
PRINTF("BSP Library : " ARDUINO_BSP_VERSION "\r\n");
151+
PRINTF("Bootloader : %s\r\n", getBootloaderVersion());
152+
PRINTF("Serial No : %s\r\n", getMcuUniqueID());
153+
PRINTF("\r\n");
154154
}
155155

156156
/******************************************************************************/

cores/nRF5/verify.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extern "C"
6767
{
6868
PRINTF("0x%lX (%ld)", _status, _status);
6969
}
70-
PRINTF("\n");
70+
PRINTF("\r\n");
7171
}
7272
#else
7373
#define VERIFY_MESS(_status, _funcstr)

libraries/Bluefruit52Lib/examples/DualRoles/dual_bleuart/dual_bleuart.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ void setup()
4242
// SRAM usage required by SoftDevice will increase with number of connections
4343
Bluefruit.begin(1, 1);
4444
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
45-
Bluefruit.setName("Bluefruit52 duo");
4645

4746
// Callbacks for Peripheral
4847
Bluefruit.Periph.setConnectCallback(prph_connect_callback);

libraries/Bluefruit52Lib/examples/Peripheral/StandardFirmataBLE/StandardFirmataBLE.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,6 @@ void setup()
790790
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
791791

792792
Bluefruit.begin();
793-
Bluefruit.setName("Bluefruit52");
794793
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
795794

796795
// try to go as fast as possible, could be rejected by some central, increase it if needed

libraries/Bluefruit52Lib/examples/Peripheral/adv_AdafruitColor/adv_AdafruitColor.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ char nibble_to_hex(uint8_t nibble) { // convert a 4-bit nibble to a hexadecimal
4040

4141
void setup()
4242
{
43-
Serial.begin(115200);
44-
while ( !Serial ) delay(10); // for nrf52840 with native usb
43+
// Serial.begin(115200);
44+
// while ( !Serial ) delay(10);
4545

4646
Serial.println("Bluefruit52 Color Advertising Example");
4747
Serial.println("----------------------------------------\n");

libraries/Bluefruit52Lib/examples/Peripheral/adv_advanced/adv_advanced.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ void setup()
3636

3737
Bluefruit.begin();
3838
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
39-
Bluefruit.setName("Bluefruit52");
4039

4140
// Set up and start advertising
4241
startAdv();

libraries/Bluefruit52Lib/examples/Peripheral/beacon/beacon.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void setup()
4848
// off Blue LED for lowest power consumption
4949
Bluefruit.autoConnLed(false);
5050
Bluefruit.setTxPower(0); // Check bluefruit.h for supported values
51-
Bluefruit.setName("Bluefruit52");
5251

5352
// Manufacturer ID is required for Manufacturer Specific Data
5453
beacon.setManufacturer(MANUFACTURER_ID);

libraries/Bluefruit52Lib/examples/Peripheral/blemidi/blemidi.ino

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ void setup()
5050
Bluefruit.configPrphBandwidth(BANDWIDTH_MAX);
5151

5252
Bluefruit.begin();
53-
Bluefruit.setName("Bluefruit52 MIDI");
5453
Bluefruit.setTxPower(4); // Check bluefruit.h for supported values
5554

5655
// Setup the on board blue LED to be enabled on CONNECT

0 commit comments

Comments
 (0)