Skip to content

Commit 39e5a79

Browse files
committed
Renaming *_msg to *_print
- Fixing long-standing print api inconsistency - Also fixes api calls
1 parent f29eaf6 commit 39e5a79

File tree

22 files changed

+172
-172
lines changed

22 files changed

+172
-172
lines changed

Debug/cli/cli.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ void cliFunc_periodic( char* args )
689689
}
690690

691691
// Show number of clock cycles between periods
692-
info_msg("Period Clock Cycles: ");
692+
info_print("Period Clock Cycles: ");
693693
printInt32( Periodic_cycles() );
694694
}
695695

@@ -704,7 +704,7 @@ void cliFunc_rand( char* args )
704704
return;
705705
}
706706

707-
info_msg("Rand: ");
707+
info_print("Rand: ");
708708
printHex32( rand_value32() );
709709
}
710710

@@ -714,7 +714,7 @@ void cliFunc_reload( char* args )
714714
{
715715
print( NL );
716716
warn_printNL("flashModeEnabled not set, cancelling firmware reload...");
717-
info_msg("Set flashModeEnabled to 1 in your kll configuration.");
717+
info_print("Set flashModeEnabled to 1 in your kll configuration.");
718718
return;
719719
}
720720

@@ -741,7 +741,7 @@ void cliFunc_tick( char* args )
741741
Time now = Time_now();
742742

743743
// Display <systick>:<cycleticks since systick>
744-
info_msg("ns per cycletick: ");
744+
info_print("ns per cycletick: ");
745745
print( Time_ticksPer_ns_str );
746746
print( NL );
747747
info_printNL("<systick ms>:<cycleticks since systick>");

Debug/print/print.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@
6464

6565
// Info Messages
6666
#define info_dPrint(...) dPrintMsg ("1;32", "INFO", __VA_ARGS__) // Info Msg
67-
#define info_print(str) printMsgNL ("1;32", "INFO", str) // Info Msg
68-
#define info_msg(str) printMsg ("1;32", "INFO", str) // Info Msg
67+
#define info_print(str) printMsg ("1;32", "INFO", str) // Info Msg
68+
#define info_printNL(str) printMsgNL ("1;32", "INFO", str) // Info Msg
6969

7070
// Warning Messages
7171
#define warn_dPrint(...) dPrintMsg ("1;33", "WARNING", __VA_ARGS__) // Warning Msg
72-
#define warn_print(str) printMsgNL ("1;33", "WARNING", str) // Warning Msg
73-
#define warn_msg(str) printMsg ("1;33", "WARNING", str) // Warning Msg
72+
#define warn_print(str) printMsg ("1;33", "WARNING", str) // Warning Msg
73+
#define warn_printNL(str) printMsgNL ("1;33", "WARNING", str) // Warning Msg
7474

7575
// Error Messages
7676
#define erro_dPrint(...) dPrintMsg ("1;5;31", "ERROR", __VA_ARGS__) // Error Msg
77-
#define erro_print(str) printMsgNL ("1;5;31", "ERROR", str) // Error Msg
78-
#define erro_msg(str) printMsg ("1;5;31", "ERROR", str) // Error Msg
77+
#define erro_print(str) printMsg ("1;5;31", "ERROR", str) // Error Msg
78+
#define erro_printNL(str) printMsgNL ("1;5;31", "ERROR", str) // Error Msg
7979

8080
// Debug Messages
8181
#define dbug_dPrint(...) dPrintMsg ("1;35", "DEBUG", __VA_ARGS__) // Debug Msg
82-
#define dbug_print(str) printMsgNL ("1;35", "DEBUG", str) // Debug Msg
83-
#define dbug_msg(str) printMsg ("1;35", "DEBUG", str) // Debug Msg
82+
#define dbug_print(str) printMsg ("1;35", "DEBUG", str) // Debug Msg
83+
#define dbug_printNL(str) printMsgNL ("1;35", "DEBUG", str) // Debug Msg
8484

8585

8686
// Static String Printing

Macro/PartialMap/macro.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ uint8_t Macro_pressReleaseAdd( void *trigger_ptr )
518518
case ScheduleType_O:
519519
break;
520520
default:
521-
erro_msg("Invalid key state - ");
521+
erro_print("Invalid key state - ");
522522
error = 1;
523523
break;
524524
}
@@ -543,15 +543,15 @@ uint8_t Macro_pressReleaseAdd( void *trigger_ptr )
543543

544544
// Invalid TriggerGuide type for Interconnect
545545
default:
546-
erro_msg("Invalid type - ");
546+
erro_print("Invalid type - ");
547547
error = 1;
548548
break;
549549
}
550550

551551
// Check if ScanCode is out of range
552552
if ( trigger->index > MaxScanCode_KLL )
553553
{
554-
warn_msg("ScanCode is out of range/not defined - ");
554+
warn_print("ScanCode is out of range/not defined - ");
555555
error = 1;
556556
}
557557

@@ -624,7 +624,7 @@ void Macro_keyState( uint16_t scanCode, uint8_t state )
624624
// Check if ScanCode is out of range
625625
if ( scanCode > MaxScanCode_KLL )
626626
{
627-
warn_msg("ScanCode is out of range/not defined: ");
627+
warn_print("ScanCode is out of range/not defined: ");
628628
printInt16( scanCode );
629629
print( NL );
630630
return;
@@ -749,7 +749,7 @@ void Macro_animationState( uint16_t animationIndex, uint8_t state )
749749
// Check if animation index is out of range
750750
if ( animationIndex > AnimationNum_KLL )
751751
{
752-
warn_msg("AnimationIndex is out of range/not defined: ");
752+
warn_print("AnimationIndex is out of range/not defined: ");
753753
printInt16( animationIndex );
754754
print( NL );
755755
return;
@@ -807,7 +807,7 @@ void Macro_layerState( uint16_t layerIndex, uint8_t state )
807807
// Check if layer is out of range
808808
if ( layerIndex > LayerNum_KLL )
809809
{
810-
warn_msg("LayerIndex is out of range/not defined: ");
810+
warn_print("LayerIndex is out of range/not defined: ");
811811
printInt16( layerIndex );
812812
print( NL );
813813
return;
@@ -863,7 +863,7 @@ void Macro_timeState( uint8_t type, uint16_t cur_time, uint8_t state )
863863

864864
// Ignore if not the correct type
865865
default:
866-
warn_msg("Invalid time state trigger update: ");
866+
warn_print("Invalid time state trigger update: ");
867867
printHex( type );
868868
print(NL);
869869
return;
@@ -873,7 +873,7 @@ void Macro_timeState( uint8_t type, uint16_t cur_time, uint8_t state )
873873
// When this function called the trigger is active
874874
if ( cur_time > 0xFF )
875875
{
876-
warn_msg("Only 255 time instances are accepted for a time state trigger: ");
876+
warn_print("Only 255 time instances are accepted for a time state trigger: ");
877877
printInt16( cur_time );
878878
print(NL);
879879
return;
@@ -1081,7 +1081,7 @@ void Macro_periodic()
10811081

10821082
// Not implemented
10831083
default:
1084-
erro_msg("Interconnect Trigger Event Type - Not Implemented ");
1084+
erro_print("Interconnect Trigger Event Type - Not Implemented ");
10851085
printHex( macroInterconnectCache[ c ].type );
10861086
print( NL );
10871087
break;
@@ -1120,7 +1120,7 @@ void Macro_periodic()
11201120
// Bug!
11211121
else
11221122
{
1123-
erro_msg("Macro Trigger Event Overflow! Serious Bug! ");
1123+
erro_print("Macro Trigger Event Overflow! Serious Bug! ");
11241124
printInt16( macroTriggerEventBufferSize );
11251125
print( NL );
11261126
macroTriggerEventBufferSize = 0;
@@ -1221,14 +1221,14 @@ void cliFunc_capDebug( char* args )
12211221
capDebugMode = capDebugMode ? 0 : 1;
12221222

12231223
print( NL );
1224-
info_msg("Capability Debug Mode: ");
1224+
info_print("Capability Debug Mode: ");
12251225
printInt8( capDebugMode );
12261226
}
12271227

12281228
void cliFunc_capList( char* args )
12291229
{
12301230
print( NL );
1231-
info_msg("Capabilities List ");
1231+
info_print("Capabilities List ");
12321232
printHex( CapabilitiesNum );
12331233

12341234
// Iterate through all of the capabilities and display them
@@ -1293,7 +1293,7 @@ void cliFunc_capSelect( char* args )
12931293
{
12941294
// Indicate that the capability was called
12951295
print( NL );
1296-
info_msg("K");
1296+
info_print("K");
12971297
printInt8( cap );
12981298
print(" - ");
12991299
printHex( argSet[0] );
@@ -1311,7 +1311,7 @@ void cliFunc_capSelect( char* args )
13111311
{
13121312
print( NL );
13131313
warn_printNL("flashModeEnabled not set, cancelling firmware reload...");
1314-
info_msg("Set flashModeEnabled to 1 in your kll configuration.");
1314+
info_print("Set flashModeEnabled to 1 in your kll configuration.");
13151315
return;
13161316
}
13171317
}
@@ -1413,14 +1413,14 @@ void cliFunc_layerDebug( char *args )
14131413
layerDebugMode = layerDebugMode ? 0 : 1;
14141414

14151415
print( NL );
1416-
info_msg("Layer Debug Mode: ");
1416+
info_print("Layer Debug Mode: ");
14171417
printInt8( layerDebugMode );
14181418
}
14191419

14201420
void cliFunc_layerList( char* args )
14211421
{
14221422
print( NL );
1423-
info_msg("Layer List");
1423+
info_print("Layer List");
14241424

14251425
// Iterate through all of the layers and display them
14261426
for ( index_uint_t layer = 0; layer < LayerNum; layer++ )
@@ -1483,7 +1483,7 @@ void cliFunc_layerState( char* args )
14831483

14841484
// Display operation (to indicate that it worked)
14851485
print( NL );
1486-
info_msg("Setting Layer L");
1486+
info_print("Setting Layer L");
14871487
printInt8( arg1 );
14881488
print(" to - ");
14891489
printHex( arg2 );
@@ -1528,15 +1528,15 @@ void cliFunc_macroDebug( char* args )
15281528
}
15291529

15301530
print( NL );
1531-
info_msg("Macro Debug Mode: ");
1531+
info_print("Macro Debug Mode: ");
15321532
printInt8( macroDebugMode );
15331533
}
15341534

15351535
void cliFunc_macroList( char* args )
15361536
{
15371537
// Show pending key events
15381538
print( NL );
1539-
info_msg("Pending Key Events: ");
1539+
info_print("Pending Key Events: ");
15401540
printInt16( (uint16_t)macroTriggerEventBufferSize );
15411541
print(" : ");
15421542
for ( var_uint_t key = 0; key < macroTriggerEventBufferSize; key++ )
@@ -1547,7 +1547,7 @@ void cliFunc_macroList( char* args )
15471547

15481548
// Show pending trigger macros
15491549
print( NL );
1550-
info_msg("Pending Trigger Macros: ");
1550+
info_print("Pending Trigger Macros: ");
15511551
printInt16( (uint16_t)macroTriggerMacroPendingListSize );
15521552
print(" : ");
15531553
for ( var_uint_t macro = 0; macro < macroTriggerMacroPendingListSize; macro++ )
@@ -1558,7 +1558,7 @@ void cliFunc_macroList( char* args )
15581558

15591559
// Show pending result macros
15601560
print( NL );
1561-
info_msg("Pending Result Macros: ");
1561+
info_print("Pending Result Macros: ");
15621562
printInt16( (uint16_t)macroResultMacroPendingList.size );
15631563
print(" : ");
15641564
for ( var_uint_t macro = 0; macro < macroResultMacroPendingList.size; macro++ )
@@ -1569,17 +1569,17 @@ void cliFunc_macroList( char* args )
15691569

15701570
// Show available trigger macro indices
15711571
print( NL );
1572-
info_msg("Trigger Macros Range: T0 -> T");
1572+
info_print("Trigger Macros Range: T0 -> T");
15731573
printInt16( (uint16_t)TriggerMacroNum - 1 ); // Hopefully large enough :P (can't assume 32-bit)
15741574

15751575
// Show available result macro indices
15761576
print( NL );
1577-
info_msg("Result Macros Range: R0 -> R");
1577+
info_print("Result Macros Range: R0 -> R");
15781578
printInt16( (uint16_t)ResultMacroNum - 1 ); // Hopefully large enough :P (can't assume 32-bit)
15791579

15801580
// Show Trigger to Result Macro Links
15811581
print( NL );
1582-
info_msg("Trigger : Result Macro Pairs");
1582+
info_print("Trigger : Result Macro Pairs");
15831583
for ( var_uint_t macro = 0; macro < TriggerMacroNum; macro++ )
15841584
{
15851585
print( NL );
@@ -1596,7 +1596,7 @@ void cliFunc_macroProc( char* args )
15961596
macroPauseMode = macroPauseMode ? 0 : 1;
15971597

15981598
print( NL );
1599-
info_msg("Macro Processing Mode: ");
1599+
info_print("Macro Processing Mode: ");
16001600
printInt8( macroPauseMode );
16011601
}
16021602

@@ -1611,7 +1611,7 @@ void macroDebugShowTrigger( var_uint_t index )
16111611
TriggerMacroRecord *record = &TriggerMacroRecordList[ index ];
16121612

16131613
print( NL );
1614-
info_msg("Trigger Macro Index: ");
1614+
info_print("Trigger Macro Index: ");
16151615
printInt16( (uint16_t)index ); // Hopefully large enough :P (can't assume 32-bit)
16161616
print( NL );
16171617

@@ -1685,7 +1685,7 @@ void macroDebugShowResult( var_uint_t index )
16851685
const ResultMacro *macro = &ResultMacroList[ index ];
16861686

16871687
print( NL );
1688-
info_msg("Result Macro Index: ");
1688+
info_print("Result Macro Index: ");
16891689
printInt16( (uint16_t)index ); // Hopefully large enough :P (can't assume 32-bit)
16901690
print( NL );
16911691

@@ -1873,7 +1873,7 @@ void cliFunc_voteDebug( char* args )
18731873
}
18741874

18751875
print( NL );
1876-
info_msg("Vote Debug Mode: ");
1876+
info_print("Vote Debug Mode: ");
18771877
printInt8( voteDebugMode );
18781878
}
18791879

Macro/PartialMap/result.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void Result_evalResultMacroCombo(
126126
// Capability debug
127127
if ( capDebugMode )
128128
{
129-
dbug_msg("Safe: ");
129+
dbug_print("Safe: ");
130130
capability( resultElem->trigger, ScheduleType_Debug, TriggerType_Debug, &guide->args );
131131
print( NL );
132132
}
@@ -436,7 +436,7 @@ void Result_process_delayed()
436436
// Capability debug
437437
if ( capDebugMode )
438438
{
439-
dbug_msg("Un-safe: ");
439+
dbug_print("Un-safe: ");
440440
capability( item->trigger, ScheduleType_Debug, TriggerType_Debug, item->args );
441441
print( NL );
442442
}

0 commit comments

Comments
 (0)