Update HAL and libs formatting

This commit is contained in:
Scott Lahteine 2018-11-10 17:51:49 -06:00
parent 47483e8c17
commit 4e0c935959
11 changed files with 620 additions and 656 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/**
* @file lcdprint_hd44780.c
* @file lcdprint_hd44780.cpp
* @brief LCD print api for HD44780
* @author Yunhui Fu (yhfudev@gmail.com)
* @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
} hd44780_charmap_t;
#if defined(__AVR__)
#ifdef __AVR__
#define IV(a) U##a
#else
#define IV(a) L##a

View File

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

File diff suppressed because it is too large Load Diff