Fix some errors found in build testing + clean-up some issues with last changes to remove use of printf() from within the OS.
This commit is contained in:
parent
b4f2b0dfc6
commit
987a8298f2
@ -43,6 +43,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
@ -549,7 +550,7 @@ int lc823450_wdt_initialize(void)
|
||||
#else
|
||||
if (getreg32(WDT_WT0RSTS) & (1 << WDT_WT0RSTS_RSTS))
|
||||
{
|
||||
wdwarn("**** WATCHDOG RESET****\n");
|
||||
syslog(LOG_EMERG, "**** WATCHDOG RESET****\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -577,7 +578,7 @@ void lc823450_wdt_work_enable(int en)
|
||||
|
||||
if (getreg32(WDT_WT0RSTS) & (1 << WDT_WT0RSTS_RSTS))
|
||||
{
|
||||
wdwarn("**** WATCHDOG RESET****\n");
|
||||
syslog(LOG_EMERG, "**** WATCHDOG RESET****\n");
|
||||
}
|
||||
|
||||
if (getreg32(LOCKUPR) & LOCKUPR_LOCKUPR0)
|
||||
|
@ -363,7 +363,7 @@ int stm32_bbsram_int(void)
|
||||
rv = hardfault_get_desc(&desc);
|
||||
if (rv >= OK)
|
||||
{
|
||||
_err("ERROR: There is a hard fault logged.\n");
|
||||
syslog(LOG_EMERG, "ERROR: There is a hard fault logged.\n");
|
||||
state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1;
|
||||
|
||||
syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x "
|
||||
|
@ -362,7 +362,7 @@ int stm32_bbsram_int(void)
|
||||
rv = hardfault_get_desc(&desc);
|
||||
if (rv >= OK)
|
||||
{
|
||||
_err("There is a hard fault logged.\n");
|
||||
syslog(LOG_EMERG, "There is a hard fault logged.\n");
|
||||
state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1;
|
||||
|
||||
syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x "
|
||||
|
@ -120,7 +120,7 @@
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
# define message(...) _info(__VA_ARGS__)
|
||||
# else
|
||||
# define message(...) _err(__VA_ARGS__)
|
||||
# define message(...) syslog(LOG_INFO, __VA_ARGS__)
|
||||
# endif
|
||||
#else
|
||||
# ifdef CONFIG_DEBUG_INFO
|
||||
|
@ -1291,7 +1291,7 @@ int mfrc522_selftest(FAR struct mfrc522_dev_s *dev)
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0};
|
||||
char outbuf[3 * 8 + 1]
|
||||
char outbuf[3 * 8 + 1];
|
||||
uint8_t result[64];
|
||||
int i;
|
||||
int j;
|
||||
@ -1354,7 +1354,7 @@ int mfrc522_selftest(FAR struct mfrc522_dev_s *dev)
|
||||
|
||||
for (i = 0; i < 64; i += 8)
|
||||
{
|
||||
for (j = 0; k = 0; j < 8; j++, k += 3)
|
||||
for (j = 0, k = 0; j < 8; j++, k += 3)
|
||||
{
|
||||
(void)sprintf(&outbuf[k], " %02x", result[i + j]);
|
||||
}
|
||||
|
@ -2352,8 +2352,10 @@ static int smart_scan(FAR struct smart_struct_s *dev)
|
||||
dev->releasecount[sector / dev->sectorsPerBlk]++;
|
||||
#else
|
||||
smart_update_cache(dev, 0, newsector);
|
||||
#ifdef CONFIG_MTD_SMART_PACK_COUNTS
|
||||
smart_add_count(dev, dev->freecount, newsector / dev->sectorsPerBlk, -1);
|
||||
smart_add_count(dev, dev->releasecount, sector / dev->sectorsPerBlk, 1);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -3243,7 +3245,8 @@ static int smart_relocate_block(FAR struct smart_struct_s *dev, uint16_t block)
|
||||
#ifdef CONFIG_SMART_LOCAL_CHECKFREE
|
||||
if (smart_checkfree(dev, __LINE__) != OK)
|
||||
{
|
||||
fwarn(" ...while relocating block %d, free=%d\n", block, dev->freesectors);
|
||||
fwarn(" ...while relocating block %d, free=%d\n",
|
||||
block, dev->freesectors);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -3625,7 +3628,7 @@ retry:
|
||||
ferr("ERROR: Program bug! Expected a free sector, free=%d\n",
|
||||
dev->freesectors);
|
||||
|
||||
for (i = 0, remaining = dev->neraseblock;
|
||||
for (i = 0, remaining = dev->neraseblocks;
|
||||
remaining > 0;
|
||||
i += 8, remaining -= 8)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user