Skip to content

Commit f29eaf6

Browse files
committed
Renaming *_print to *_printNL
- Fixing long-standing print api inconsistency - Next commit will handle *_msg to *_print
1 parent c1b8732 commit f29eaf6

File tree

31 files changed

+102
-102
lines changed

31 files changed

+102
-102
lines changed

Debug/cli/cli.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int CLI_process()
178178
if ( CLILineBufferCurrent >= CLILineBufferMaxSize )
179179
{
180180
print( NL );
181-
erro_print("Serial line buffer is full, dropping character and resetting...");
181+
erro_printNL("Serial line buffer is full, dropping character and resetting...");
182182

183183
// Clear buffer
184184
CLILineBufferCurrent = 0;
@@ -422,7 +422,7 @@ void CLI_registerDictionary( const CLIDictItem *cmdDict, const char* dictName )
422422
// Make sure this max limit of dictionaries hasn't been reached
423423
if ( CLIDictionariesUsed >= CLIMaxDictionaries )
424424
{
425-
erro_print("Max number of dictionaries defined already...");
425+
erro_printNL("Max number of dictionaries defined already...");
426426
return;
427427
}
428428

@@ -557,13 +557,13 @@ void cliFunc_cliDebug( char* args )
557557
if ( CLIHexDebugMode )
558558
{
559559
print( NL );
560-
info_print("Hex debug mode disabled...");
560+
info_printNL("Hex debug mode disabled...");
561561
CLIHexDebugMode = 0;
562562
}
563563
else
564564
{
565565
print( NL );
566-
info_print("Hex debug mode enabled...");
566+
info_printNL("Hex debug mode enabled...");
567567
CLIHexDebugMode = 1;
568568
}
569569
}
@@ -700,7 +700,7 @@ void cliFunc_rand( char* args )
700700
// Check if entropy available
701701
if ( !rand_available() )
702702
{
703-
warn_print("No entropy available!");
703+
warn_printNL("No entropy available!");
704704
return;
705705
}
706706

@@ -713,7 +713,7 @@ void cliFunc_reload( char* args )
713713
if ( flashModeEnabled_define == 0 )
714714
{
715715
print( NL );
716-
warn_print("flashModeEnabled not set, cancelling firmware reload...");
716+
warn_printNL("flashModeEnabled not set, cancelling firmware reload...");
717717
info_msg("Set flashModeEnabled to 1 in your kll configuration.");
718718
return;
719719
}
@@ -744,7 +744,7 @@ void cliFunc_tick( char* args )
744744
info_msg("ns per cycletick: ");
745745
print( Time_ticksPer_ns_str );
746746
print( NL );
747-
info_print("<systick ms>:<cycleticks since systick>");
747+
info_printNL("<systick ms>:<cycleticks since systick>");
748748
printInt32( now.ms );
749749
print(":");
750750
printInt32( now.ticks );

Debug/latency/latency.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ uint8_t Latency_add_resource( const char* name, LatencyOption option )
6969
// Make sure there are resources left to allocate
7070
if ( index >= LatencyMeasurementCount_define )
7171
{
72-
erro_print("No more latency resources available...");
72+
erro_printNL("No more latency resources available...");
7373
return 0;
7474
}
7575

Lib/kinetis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void systick_default_isr()
116116
if ( ARM_DWT_CYCCNT > F_CPU / 1000 + 30 )
117117
{
118118
/* XXX (HaaTa) The printing of this message is causing LED buffers to get clobbered (likely due to frame overflows)
119-
erro_print("SysTick is being starved by another IRQ...");
119+
erro_printNL("SysTick is being starved by another IRQ...");
120120
printInt32( ARM_DWT_CYCCNT );
121121
print(" vs. ");
122122
printInt32( F_CPU / 1000 );

Lib/sam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void systick_default_isr()
166166
if ( DWT->CYCCNT > F_CPU / 1000 + 30 )
167167
{
168168
/* XXX (HaaTa) The printing of this message is causing LED buffers to get clobbered (likely due to frame overflows)
169-
erro_print("SysTick is being starved by another IRQ...");
169+
erro_printNL("SysTick is being starved by another IRQ...");
170170
printInt32( DWT->CYCCNT );
171171
print(" vs. ");
172172
printInt32( F_CPU / 1000 );

Macro/PartialMap/macro.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ void Macro_periodic()
11141114
if ( MaxScanCode_KLL == 0 )
11151115
{
11161116
#if NoneScanModule_define == 0
1117-
warn_print("No scancodes defined! Check your BaseMap!");
1117+
warn_printNL("No scancodes defined! Check your BaseMap!");
11181118
#endif
11191119
}
11201120
// Bug!
@@ -1135,7 +1135,7 @@ void Macro_periodic()
11351135

11361136
// Proceed, decrementing the step counter
11371137
macroStepCounter--;
1138-
dbug_print("Macro Step");
1138+
dbug_printNL("Macro Step");
11391139
}
11401140

11411141
// Process Trigger Macros
@@ -1310,7 +1310,7 @@ void cliFunc_capSelect( char* args )
13101310
if ( CapabilitiesList[ cap ].func == (const void*)Output_flashMode_capability )
13111311
{
13121312
print( NL );
1313-
warn_print("flashModeEnabled not set, cancelling firmware reload...");
1313+
warn_printNL("flashModeEnabled not set, cancelling firmware reload...");
13141314
info_msg("Set flashModeEnabled to 1 in your kll configuration.");
13151315
return;
13161316
}

Macro/PartialMap/result.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void Result_evalResultMacroCombo(
190190
}
191191
else
192192
{
193-
warn_print("Delayed capability stack full!");
193+
warn_printNL("Delayed capability stack full!");
194194
}
195195

196196
// Increment counters
@@ -251,7 +251,7 @@ void Result_appendResultMacroToPendingList( const TriggerMacro *triggerMacro )
251251
if ( cur_event == 0 )
252252
{
253253

254-
erro_print("Could not find event in event buffer for activated trigger! This is a bug!");
254+
erro_printNL("Could not find event in event buffer for activated trigger! This is a bug!");
255255
continue;
256256
}
257257

@@ -320,7 +320,7 @@ void Result_appendResultMacroToPendingList( const TriggerMacro *triggerMacro )
320320
// If event was not set, ignore
321321
if ( !event )
322322
{
323-
erro_print("No event found! Bug!");
323+
erro_printNL("No event found! Bug!");
324324
return;
325325
}
326326

Macro/PartialMap/trigger.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ TriggerMacroVote Trigger_evalShortTriggerMacroVote( TriggerEvent *event, Trigger
270270
}
271271

272272
// TODO (HaaTa) Implement state scheduling
273-
erro_print("State Scheduling not implemented yet...");
273+
erro_printNL("State Scheduling not implemented yet...");
274274
}
275275

276276
vote = TriggerMacroVote_DoNothing;
@@ -304,7 +304,7 @@ TriggerMacroVote Trigger_evalShortTriggerMacroVote( TriggerEvent *event, Trigger
304304
case TriggerType_Analog2:
305305
case TriggerType_Analog3:
306306
case TriggerType_Analog4:
307-
erro_print("Analog State Type - Not implemented...");
307+
erro_printNL("Analog State Type - Not implemented...");
308308
break;
309309

310310
// Animation State Type
@@ -348,7 +348,7 @@ TriggerMacroVote Trigger_evalShortTriggerMacroVote( TriggerEvent *event, Trigger
348348

349349
// Invalid State Type
350350
default:
351-
erro_print("Invalid State Type. This is a bug.");
351+
erro_printNL("Invalid State Type. This is a bug.");
352352
break;
353353
}
354354

@@ -502,7 +502,7 @@ TriggerMacroVote Trigger_evalLongTriggerMacroVote( TriggerEvent *event, TriggerG
502502
case TriggerType_Analog2:
503503
case TriggerType_Analog3:
504504
case TriggerType_Analog4:
505-
erro_print("Analog State Type - Not implemented...");
505+
erro_printNL("Analog State Type - Not implemented...");
506506
break;
507507

508508
// Animation State Type
@@ -535,12 +535,12 @@ TriggerMacroVote Trigger_evalLongTriggerMacroVote( TriggerEvent *event, TriggerG
535535
// This makes rotations not so useful for long macros
536536
// (though it may be possible to implement it if there is demand)
537537
// TODO
538-
erro_print("Rotation State Type (Long Macros) - Not implemented...");
538+
erro_printNL("Rotation State Type (Long Macros) - Not implemented...");
539539
break;
540540

541541
// Invalid State Type
542542
default:
543-
erro_print("Invalid State Type. This is a bug.");
543+
erro_printNL("Invalid State Type. This is a bug.");
544544
break;
545545
}
546546

Macro/PixelMap/pixel.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ uint8_t Pixel_addAnimation( AnimationStackElement *element, CapabilityState csta
10271027
// Make sure there is room left on the stack
10281028
if ( Pixel_AnimationStack.size >= Pixel_AnimationStackSize )
10291029
{
1030-
warn_print("Animation stack is full...");
1030+
warn_printNL("Animation stack is full...");
10311031
return 0;
10321032
}
10331033

@@ -1048,7 +1048,7 @@ uint8_t Pixel_addAnimation( AnimationStackElement *element, CapabilityState csta
10481048
// XXX This shouldn't happen
10491049
if ( pos >= Pixel_AnimationStackSize )
10501050
{
1051-
erro_print("Animation Stack memory leak...this is a bug!");
1051+
erro_printNL("Animation Stack memory leak...this is a bug!");
10521052
return 0;
10531053
}
10541054

@@ -1256,7 +1256,7 @@ PixelBuf *LED_bufferMap( uint16_t channel )
12561256
case 32: /* 32 bit mapping */ \
12571257
PixelBuf32( pixbuf, ch_pos ) op (uint32_t)mod_value; break; \
12581258
default: \
1259-
warn_print("Invalid width mapping for "#op ); \
1259+
warn_printNL("Invalid width mapping for "#op ); \
12601260
break; \
12611261
}
12621262

@@ -1319,7 +1319,7 @@ void Pixel_pixelEvaluation( PixelModElement *mod, PixelElement *elem )
13191319
break;
13201320

13211321
default:
1322-
warn_print("Invalid PixelElement width mapping");
1322+
warn_printNL("Invalid PixelElement width mapping");
13231323
break;
13241324
}
13251325

@@ -1381,7 +1381,7 @@ void Pixel_pixelEvaluation( PixelModElement *mod, PixelElement *elem )
13811381
}
13821382

13831383
default:
1384-
warn_print("Invalid width mapping on set");
1384+
warn_printNL("Invalid width mapping on set");
13851385
break;
13861386
}
13871387
break;
@@ -1416,13 +1416,13 @@ void Pixel_pixelEvaluation( PixelModElement *mod, PixelElement *elem )
14161416
}
14171417

14181418
default:
1419-
warn_print("Invalid width mapping on set");
1419+
warn_printNL("Invalid width mapping on set");
14201420
break;
14211421
}
14221422
break;
14231423

14241424
default:
1425-
warn_print("Unimplemented pixel modifier");
1425+
warn_printNL("Unimplemented pixel modifier");
14261426
break;
14271427
}
14281428
}
@@ -1731,7 +1731,7 @@ uint16_t Pixel_pixelTweenNextPos( PixelElement *elem, PixelElement *prev )
17311731

17321732
// BAD BAD BAD
17331733
// TODO - This is BAD, will break in most cases, except for K-Type like keyboards.
1734-
erro_print("Pixel Tween Bug!");
1734+
erro_printNL("Pixel Tween Bug!");
17351735
ret = ( ( 8 / 8 + sizeof( PixelChange ) ) * 3 ) + sizeof( PixelModElement );
17361736
#endif
17371737

@@ -2514,7 +2514,7 @@ void Pixel_SecondaryProcessing()
25142514
}
25152515
break;
25162516
default:
2517-
erro_print("Unsupported buffer width");
2517+
erro_printNL("Unsupported buffer width");
25182518
break;
25192519
}
25202520
}

Macro/buffer/macro.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ inline void keyPressDetection( uint8_t *keys, uint8_t numberOfKeys, uint8_t *mod
169169
// Too many keys
170170
if ( USBKeys_Sent >= USBKeys_MaxSize )
171171
{
172-
info_print("USB Key limit reached");
172+
info_printNL("USB Key limit reached");
173173
errorLED( 1 );
174174
break;
175175
}
@@ -353,7 +353,7 @@ void keyPressBufferRead( uint8_t *modifiers, uint8_t numberOfModifiers, uint8_t
353353
// Too many keys
354354
if ( USBKeys_Sent >= USBKeys_MaxSize )
355355
{
356-
info_print("USB Key limit reached");
356+
info_printNL("USB Key limit reached");
357357
errorLED( 1 );
358358
break;
359359
}

Output/HID-IO/hidio_com.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ HIDIO_Return HIDIO_terminal_call( uint16_t buf_pos, uint8_t irq )
796796
if ( CLILineBufferCurrent >= CLILineBufferMaxSize ) {
797797
uint16_t connected = HIDIO_VT_Connected;
798798
HIDIO_VT_Connected = 0;
799-
erro_print("Serial line buffer is full, dropping character and resetting...");
799+
erro_printNL("Serial line buffer is full, dropping character and resetting...");
800800
HIDIO_VT_Connected = connected;
801801

802802
// This will automatically NAK for us
@@ -1144,14 +1144,14 @@ void HIDIO_process_incoming_packet( uint8_t *buf, uint8_t irq )
11441144

11451145
// Check header packet type to see if a valid packet
11461146
if ( packet->type > HIDIO_Packet_Type__Continued ) {
1147-
warn_print("Reserved packet type. Bug?");
1147+
warn_printNL("Reserved packet type. Bug?");
11481148
return;
11491149
}
11501150

11511151
// Check if the length is valid
11521152
uint16_t packet_len = (packet->upper_len << 8) | packet->len;
11531153
if ( packet_len > HIDIO_Packet_Size ) {
1154-
warn_print("Unsupported length");
1154+
warn_printNL("Unsupported length");
11551155
print("length: ");
11561156
printInt16(packet_len);
11571157
print(NL);
@@ -1209,7 +1209,7 @@ void HIDIO_process_incoming_packet( uint8_t *buf, uint8_t irq )
12091209
// If this is a continued packet, we drop, because we weren't waiting for one
12101210
if ( packet->type == HIDIO_Packet_Type__Continued )
12111211
{
1212-
warn_print("Dropping incoming Continued Data packet...");
1212+
warn_printNL("Dropping incoming Continued Data packet...");
12131213
return;
12141214
}
12151215

@@ -1219,7 +1219,7 @@ void HIDIO_process_incoming_packet( uint8_t *buf, uint8_t irq )
12191219
{
12201220
uint16_t connected = HIDIO_VT_Connected;
12211221
HIDIO_VT_Connected = 0;
1222-
warn_print("Dropping incoming Data packet, not enough buffer space...");
1222+
warn_printNL("Dropping incoming Data packet, not enough buffer space...");
12231223
print("head: ");
12241224
printInt16( HIDIO_assembly_buf.head );
12251225
print(" tail: ");

Output/UARTOut/arm/uart_serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ void uart_device_reload()
409409
if ( flashModeEnabled_define == 0 )
410410
{
411411
print( NL );
412-
warn_print("flashModeEnabled not set, cancelling firmware reload...");
412+
warn_printNL("flashModeEnabled not set, cancelling firmware reload...");
413413
info_msg("Set flashModeEnabled to 1 in your kll configuration.");
414414
return;
415415
}
@@ -427,7 +427,7 @@ void uart_device_reload()
427427
if ( GPIOA_PDIR & (1<<3) && flashModeEnabled_define != 0 )
428428
{
429429
print( NL );
430-
warn_print("Security jumper not present, cancelling firmware reload...");
430+
warn_printNL("Security jumper not present, cancelling firmware reload...");
431431
info_msg("Replace jumper on middle 2 pins, or manually press the firmware reload button.");
432432
}
433433
else

Output/USB/arm/usb_dev.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ uint8_t usb_resume()
13781378
if ( usb_suspended() && usb_configured() && usb_remote_wakeup )
13791379
{
13801380
#if enableRawIO_define != 1
1381-
info_print("Attempting to resume the host");
1381+
info_printNL("Attempting to resume the host");
13821382
#endif
13831383

13841384
#if defined(_kinetis_)
@@ -1399,7 +1399,7 @@ uint8_t usb_resume()
13991399
}
14001400

14011401
#else
1402-
warn_print("Host Resume Disabled");
1402+
warn_printNL("Host Resume Disabled");
14031403
#endif
14041404

14051405
return 0;
@@ -1753,7 +1753,7 @@ void usb_isr()
17531753
usb_dev_sleep = 1;
17541754
}
17551755
#else
1756-
info_print("USB Suspend Detected - Firmware USB Suspend Disabled");
1756+
info_printNL("USB Suspend Detected - Firmware USB Suspend Disabled");
17571757
#endif
17581758
// Enable USB resume interrupt
17591759
// Only allowed to be enabled while suspended
@@ -1784,12 +1784,12 @@ void usb_isr()
17841784
void usb_set_sleep_state(bool sleep) {
17851785
if (sleep) {
17861786
#if enableRawIO_define != 1
1787-
info_print("Host has requested USB sleep/suspend state");
1787+
info_printNL("Host has requested USB sleep/suspend state");
17881788
#endif
17891789
Output_update_usb_current( 100 ); // Set to 100 mA
17901790
} else {
17911791
#if enableRawIO_define != 1
1792-
info_print("Host has woken-up/resumed from sleep/suspend state");
1792+
info_printNL("Host has woken-up/resumed from sleep/suspend state");
17931793
#endif
17941794
Output_update_usb_current( *usb_bMaxPower * 2 );
17951795
}

0 commit comments

Comments
 (0)