Fix nxstyle issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-05-07 00:16:58 +08:00
committed by patacongo
parent 94bb2e05bb
commit 3e00d182d2
7 changed files with 59 additions and 55 deletions
+1
View File
@@ -60,6 +60,7 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* USB trace dumping */ /* USB trace dumping */
#ifndef CONFIG_USBDEV_TRACE #ifndef CONFIG_USBDEV_TRACE
+19 -18
View File
@@ -93,11 +93,13 @@ static void up_stackdump(uint16_t sp, uint16_t stack_base)
for (stack = sp; stack < stack_base; stack += 16) for (stack = sp; stack < stack_base; stack += 16)
{ {
uint8_t *ptr = (uint8_t*)stack; uint8_t *ptr = (uint8_t *)stack;
_alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x" _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
" %02x %02x %02x %02x %02x %02x %02x %02x\n", " %02x %02x %02x %02x %02x %02x %02x %02x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7], stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4],
ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]); ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10],
ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]);
} }
} }
#else #else
@@ -130,23 +132,22 @@ static inline void up_registerdump(void)
_alert("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n", _alert("SP:%02x%02x FRAME:%02x%02x TMP:%02x%02x Z:%02x%02x XY:%02x\n",
regs[REG_SPH], regs[REG_SPL], regs[REG_FRAMEH], regs[REG_FRAMEL], regs[REG_SPH], regs[REG_SPL], regs[REG_FRAMEH], regs[REG_FRAMEL],
regs[REG_TMPL], regs[REG_TMPH], regs[REG_ZL], regs[REG_ZH], regs[REG_TMPL], regs[REG_TMPH], regs[REG_ZL], regs[REG_ZH],
regs[REG_XY], regs[REG_XY+1]); regs[REG_XY], regs[REG_XY + 1]);
#if CONFIG_HCS12_MSOFTREGS > 2 #if CONFIG_HCS12_MSOFTREGS > 2
# error "Need to save more registers" # error "Need to save more registers"
#elif CONFIG_HCS12_MSOFTREGS == 2 #elif CONFIG_HCS12_MSOFTREGS == 2
_alert("SOFTREGS: %02x%02x :%02x%02x\n", _alert("SOFTREGS: %02x%02x :%02x%02x\n",
regs[REG_SOFTREG1], regs[REG_SOFTREG1+1], regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1],
regs[REG_SOFTREG2], regs[REG_SOFTREG2+1]); regs[REG_SOFTREG2], regs[REG_SOFTREG2 + 1]);
#elif CONFIG_HCS12_MSOFTREGS == 1 #elif CONFIG_HCS12_MSOFTREGS == 1
_alert("SOFTREGS: %02x%02x\n", _alert("SOFTREGS: %02x%02x\n",
regs[REG_SOFTREG1], regs[REG_SOFTREG1+1]); regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1]);
#endif #endif
#ifndef CONFIG_HCS12_NONBANKED #ifndef CONFIG_HCS12_NONBANKED
_alert("PPAGE: %02x\n", regs[REG_PPAGE]); _alert("PPAGE: %02x\n", regs[REG_PPAGE]);
#endif #endif
}
} }
#else #else
# define up_registerdump() # define up_registerdump()
@@ -295,19 +296,19 @@ static void _up_assert(int errorcode)
if (g_current_regs || (running_task())->flink == NULL) if (g_current_regs || (running_task())->flink == NULL)
{ {
up_irq_save(); up_irq_save();
for (;;) for (; ; )
{ {
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1 #if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE); board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif #endif
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC); board_autoled_on(LED_PANIC);
up_mdelay(250); up_mdelay(250);
board_autoled_off(LED_PANIC); board_autoled_off(LED_PANIC);
up_mdelay(250); up_mdelay(250);
#endif #endif
} }
} }
else else
{ {
+9 -9
View File
@@ -94,19 +94,19 @@ static void _up_assert(int errorcode)
if (g_current_regs || running_task()->flink == NULL) if (g_current_regs || running_task()->flink == NULL)
{ {
up_irq_save(); up_irq_save();
for (; ; ) for (; ; )
{ {
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1 #if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE); board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif #endif
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC); board_autoled_on(LED_PANIC);
up_mdelay(250); up_mdelay(250);
board_autoled_off(LED_PANIC); board_autoled_off(LED_PANIC);
up_mdelay(250); up_mdelay(250);
#endif #endif
} }
} }
else else
{ {
+5 -5
View File
@@ -85,11 +85,11 @@ static void _up_assert(int errorcode)
syslog_flush(); syslog_flush();
/* Are we in an interrupt handler or the idle task? NOTE: You cannot use the /* Are we in an interrupt handler or the idle task? NOTE: You cannot use
* PID to determine if this is an IDLE task. In the SMP case, there may be * the PID to determine if this is an IDLE task. In the SMP case, there
* multiple IDLE tasks with different PIDs. The only consistent way to test * may be multiple IDLE tasks with different PIDs. The only consistent
* for the IDLE task is to check it is at the end of the list (flink == * way to test for the IDLE task is to check it is at the end of the list
* NULL) * (flink == NULL)
*/ */
if (g_current_regs || running_task()->flink == NULL) if (g_current_regs || running_task()->flink == NULL)
+9 -9
View File
@@ -90,19 +90,19 @@ static void _up_assert(int errorcode)
if (g_current_regs || running_task()->flink == NULL) if (g_current_regs || running_task()->flink == NULL)
{ {
up_irq_save(); up_irq_save();
for (;;) for (; ; )
{ {
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1 #if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE); board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif #endif
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC); board_autoled_on(LED_PANIC);
up_mdelay(250); up_mdelay(250);
board_autoled_off(LED_PANIC); board_autoled_off(LED_PANIC);
up_mdelay(250); up_mdelay(250);
#endif #endif
} }
} }
else else
{ {
+12 -11
View File
@@ -60,6 +60,7 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* USB trace dumping */ /* USB trace dumping */
#ifndef CONFIG_USBDEV_TRACE #ifndef CONFIG_USBDEV_TRACE
@@ -93,7 +94,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
for (stack = sp & ~0x1f; stack < stack_base; stack += 32) for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{ {
uint32_t *ptr = (uint32_t*)stack; uint32_t *ptr = (uint32_t *)stack;
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3], stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]); ptr[4], ptr[5], ptr[6], ptr[7]);
@@ -147,7 +148,7 @@ static void up_dumpstate(void)
if (g_current_regs != NULL) if (g_current_regs != NULL)
{ {
up_registerdump((uint32_t*)g_current_regs); up_registerdump((uint32_t *)g_current_regs);
} }
else else
{ {
@@ -256,19 +257,19 @@ static void _up_assert(int errorcode)
if (g_current_regs || (running_task())->flink == NULL) if (g_current_regs || (running_task())->flink == NULL)
{ {
up_irq_save(); up_irq_save();
for (;;) for (; ; )
{ {
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1 #if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE); board_reset(CONFIG_BOARD_ASSERT_RESET_VALUE);
#endif #endif
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC); board_autoled_on(LED_PANIC);
up_mdelay(250); up_mdelay(250);
board_autoled_off(LED_PANIC); board_autoled_off(LED_PANIC);
up_mdelay(250); up_mdelay(250);
#endif #endif
} }
} }
else else
{ {
+4 -3
View File
@@ -118,11 +118,12 @@ static int usbtrace_syslog(const char *fmt, ...)
* Name: usbtrace_enable * Name: usbtrace_enable
* *
* Description: * Description:
* Enable/disable tracing per trace ID. The initial state is all IDs enabled. * Enable/disable tracing per trace ID. The initial state is all IDs
* enabled.
* *
* Input Parameters: * Input Parameters:
* idset - The bitset of IDs to be masked. TRACE_ALLIDS enables all IDS; zero * idset - The bitset of IDs to be masked. TRACE_ALLIDS enables all IDS;
* masks all IDs. * zero masks all IDs.
* *
* Returned Value: * Returned Value:
* The previous idset value. * The previous idset value.