From 216b1513026e45e44794f15cfa4d02ff1c9d49f4 Mon Sep 17 00:00:00 2001 From: Jacob Alexander Date: Tue, 23 Jun 2015 07:58:31 -0700 Subject: [PATCH] Fixing order of layer debug stack display - Adding NL's for fault messages --- Lib/mk20dx.c | 12 ++++++------ Macro/PartialMap/macro.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/mk20dx.c b/Lib/mk20dx.c index 2b11943..47759a4 100644 --- a/Lib/mk20dx.c +++ b/Lib/mk20dx.c @@ -70,7 +70,7 @@ void ResetHandler(); // NVIC - Default ISR void fault_isr() { - print("Fault!"); + print("Fault!" NL ); while ( 1 ) { // keep polling some communication while in fault @@ -99,35 +99,35 @@ void systick_default_isr() // NVIC - Non-Maskable Interrupt ISR void nmi_default_isr() { - print("NMI!"); + print("NMI!" NL ); } // NVIC - Hard Fault ISR void hard_fault_default_isr() { - print("Hard Fault!"); + print("Hard Fault!" NL ); } // NVIC - Memory Manager Fault ISR void memmanage_fault_default_isr() { - print("Memory Manager Fault!"); + print("Memory Manager Fault!" NL ); } // NVIC - Bus Fault ISR void bus_fault_default_isr() { - print("Bus Fault!"); + print("Bus Fault!" NL ); } // NVIC - Usage Fault ISR void usage_fault_default_isr() { - print("Usage Fault!"); + print("Usage Fault!" NL ); } diff --git a/Macro/PartialMap/macro.c b/Macro/PartialMap/macro.c index 76d830e..bc2d7d6 100644 --- a/Macro/PartialMap/macro.c +++ b/Macro/PartialMap/macro.c @@ -226,10 +226,10 @@ void Macro_layerState( uint8_t state, uint8_t stateType, uint16_t layer, uint8_t print(" 0"); // Iterate over the layer stack starting from the bottom of the stack - for ( uint16_t index = 0; index < macroLayerIndexStackSize; index++ ) + for ( uint16_t index = macroLayerIndexStackSize; index > 0; index-- ) { print(":"); - printHex_op( macroLayerIndexStack[ index ], 0 ); + printHex_op( macroLayerIndexStack[ index - 1 ], 0 ); } print( NL );