Update HAL and libs formatting

2.0.x
Scott Lahteine 6 years ago
parent 47483e8c17
commit 4e0c935959

@ -145,8 +145,8 @@ static const UnwindCallbacks UnwCallbacks = {
UnwReadW, UnwReadW,
UnwReadH, UnwReadH,
UnwReadB UnwReadB
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
,UnwPrintf , UnwPrintf
#endif #endif
}; };

@ -118,7 +118,7 @@ static const UnwindCallbacks UnwCallbacks = {
UnwReadW, UnwReadW,
UnwReadH, UnwReadH,
UnwReadB UnwReadB
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
,UnwPrintf ,UnwPrintf
#endif #endif
}; };

@ -45,7 +45,7 @@
#define FTM3_CH5_PIN 36 #define FTM3_CH5_PIN 36
#define FTM3_CH6_PIN 37 #define FTM3_CH6_PIN 37
#define FTM3_CH7_PIN 38 #define FTM3_CH7_PIN 38
#if defined(__MK66FX1M0__) // Teensy3.6 #ifdef __MK66FX1M0__ // Teensy3.6
#define TPM1_CH0_PIN 16 #define TPM1_CH0_PIN 16
#define TPM1_CH1_PIN 17 #define TPM1_CH1_PIN 17
#endif #endif

@ -23,7 +23,7 @@
#include "unwarm.h" #include "unwarm.h"
#include "unwarmmem.h" #include "unwarmmem.h"
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
/** /**
* Printf wrapper. * Printf wrapper.

@ -106,7 +106,7 @@ typedef struct {
#define M_IsOriginValid(v) (((v) & 0x7F) ? true : false) #define M_IsOriginValid(v) (((v) & 0x7F) ? true : false)
#define M_Origin2Str(v) ((v) ? "VALID" : "INVALID") #define M_Origin2Str(v) ((v) ? "VALID" : "INVALID")
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
#define UnwPrintd1(a) state->cb->printf(a) #define UnwPrintd1(a) state->cb->printf(a)
#define UnwPrintd2(a,b) state->cb->printf(a,b) #define UnwPrintd2(a,b) state->cb->printf(a,b)
#define UnwPrintd3(a,b,c) state->cb->printf(a,b,c) #define UnwPrintd3(a,b,c) state->cb->printf(a,b,c)

@ -142,7 +142,7 @@ UnwResult UnwStartArm(UnwState * const state) {
/* MRS */ /* MRS */
else if ((instr & 0xFFBF0FFF) == 0xE10F0000) { else if ((instr & 0xFFBF0FFF) == 0xE10F0000) {
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
bool R = (instr & 0x00400000) ? true : false; bool R = (instr & 0x00400000) ? true : false;
#endif #endif
uint8_t rd = (instr & 0x0000F000) >> 12; uint8_t rd = (instr & 0x0000F000) >> 12;
@ -154,7 +154,7 @@ UnwResult UnwStartArm(UnwState * const state) {
} }
/* MSR */ /* MSR */
else if ((instr & 0xFFB0F000) == 0xE120F000) { else if ((instr & 0xFFB0F000) == 0xE120F000) {
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
bool R = (instr & 0x00400000) ? true : false; bool R = (instr & 0x00400000) ? true : false;
UnwPrintd2("MSR %s_?, ???", R ? "SPSR" : "CPSR"); UnwPrintd2("MSR %s_?, ???", R ? "SPSR" : "CPSR");
@ -172,7 +172,7 @@ UnwResult UnwStartArm(UnwState * const state) {
else if (isDataProc(instr)) { else if (isDataProc(instr)) {
bool I = (instr & 0x02000000) ? true : false; bool I = (instr & 0x02000000) ? true : false;
uint8_t opcode = (instr & 0x01E00000) >> 21; uint8_t opcode = (instr & 0x01E00000) >> 21;
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
bool S = (instr & 0x00100000) ? true : false; bool S = (instr & 0x00100000) ? true : false;
#endif #endif
uint8_t rn = (instr & 0x000F0000) >> 16; uint8_t rn = (instr & 0x000F0000) >> 16;
@ -220,7 +220,7 @@ UnwResult UnwStartArm(UnwState * const state) {
uint8_t regShift = (operand2 & 0x0010) ? true : false; uint8_t regShift = (operand2 & 0x0010) ? true : false;
uint8_t shiftType = (operand2 & 0x0060) >> 5; uint8_t shiftType = (operand2 & 0x0060) >> 5;
uint32_t shiftDist; uint32_t shiftDist;
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
const char * const shiftMnu[4] = { "LSL", "LSR", "ASR", "ROR" }; const char * const shiftMnu[4] = { "LSL", "LSR", "ASR", "ROR" };
#endif #endif
UnwPrintd2("r%d ", rm); UnwPrintd2("r%d ", rm);
@ -453,7 +453,7 @@ UnwResult UnwStartArm(UnwState * const state) {
bool addrValid = M_IsOriginValid(state->regData[baseReg].o); bool addrValid = M_IsOriginValid(state->regData[baseReg].o);
int8_t r; int8_t r;
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
/* Display the instruction */ /* Display the instruction */
if (L) { if (L) {
UnwPrintd6("LDM%c%c r%d%s, {reglist}%s\n", P ? 'E' : 'F', U ? 'D' : 'A', baseReg, W ? "!" : "", S ? "^" : ""); UnwPrintd6("LDM%c%c r%d%s, {reglist}%s\n", P ? 'E' : 'F', U ? 'D' : 'A', baseReg, W ? "!" : "", S ? "^" : "");

@ -680,7 +680,7 @@ UnwResult UnwStartThumb(UnwState * const state) {
uint8_t rs = (instr & 0x0038) >> 3; uint8_t rs = (instr & 0x0038) >> 3;
uint8_t rd = (instr & 0x0007); uint8_t rd = (instr & 0x0007);
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
static const char * const mnu[16] = { static const char * const mnu[16] = {
"AND", "EOR", "LSL", "LSR", "AND", "EOR", "LSL", "LSR",
"ASR", "ADC", "SBC", "ROR", "ASR", "ADC", "SBC", "ROR",

@ -90,7 +90,7 @@ bool UnwMemHashWrite(MemData * const memData, uint32_t addr, uint32_t val, bool
M_SetIdxUsed(memData->tracked, i); M_SetIdxUsed(memData->tracked, i);
} }
else { else {
#if defined(UNW_DEBUG) #ifdef UNW_DEBUG
memData->v[i] = 0xDEADBEEF; memData->v[i] = 0xDEADBEEF;
#endif #endif
M_ClrIdxUsed(memData->tracked, i); M_ClrIdxUsed(memData->tracked, i);

@ -1,5 +1,5 @@
/** /**
* @file lcdprint_hd44780.c * @file lcdprint_hd44780.cpp
* @brief LCD print api for HD44780 * @brief LCD print api for HD44780
* @author Yunhui Fu (yhfudev@gmail.com) * @author Yunhui Fu (yhfudev@gmail.com)
* @version 1.0 * @version 1.0
@ -39,7 +39,7 @@ typedef struct _hd44780_charmap_t {
uint8_t idx2; // the char used to be combined with the idx to simulate a single char uint8_t idx2; // the char used to be combined with the idx to simulate a single char
} hd44780_charmap_t; } hd44780_charmap_t;
#if defined(__AVR__) #ifdef __AVR__
#define IV(a) U##a #define IV(a) U##a
#else #else
#define IV(a) L##a #define IV(a) L##a

@ -1,5 +1,5 @@
/** /**
* @file lcdprint_u8g.c * @file lcdprint_u8g.cpp
* @brief LCD print api for u8glib * @brief LCD print api for u8glib
* @author Yunhui Fu (yhfudev@gmail.com) * @author Yunhui Fu (yhfudev@gmail.com)
* @version 1.0 * @version 1.0

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save