使用函数指针格式化%p

This commit is contained in:
大石头X2 2017-02-25 14:31:39 +08:00
parent 258835798e
commit 757fac6cd7
10 changed files with 14 additions and 14 deletions

View File

@ -186,7 +186,7 @@ void Close2Task(void * param)
else else
{ {
bt->delaytime = 0; bt->delaytime = 0;
debug_printf("延时关闭已完成 删除任务 0x%08X\r\n", bt->_task2); debug_printf("延时关闭已完成 删除任务 %p\r\n", bt->_task2);
Sys.RemoveTask(bt->_task2); Sys.RemoveTask(bt->_task2);
bt->_task2 = 0; bt->_task2 = 0;
bt->SetValue(false); bt->SetValue(false);

View File

@ -51,8 +51,8 @@ BootConfig * BootConfig::Create()
void BootConfig::Show() const void BootConfig::Show() const
{ {
debug_printf("BootConfig HasApp %d NeedUpData %d SearchPinCfg %d\r\n", Stat.HasApp, Stat.NeedUpDate, Stat.SearchPinCfg); debug_printf("BootConfig HasApp %d NeedUpData %d SearchPinCfg %d\r\n", Stat.HasApp, Stat.NeedUpDate, Stat.SearchPinCfg);
debug_printf("WorkAddr 0x%08X Length 0x%08X Depositary 0x%08X Checksum 0x%08X\r\n", App.WorkAddr, App.Length, App.Directory, App.Checksum); debug_printf("WorkAddr %p Length %p Depositary %p Checksum %p\r\n", App.WorkAddr, App.Length, App.Directory, App.Checksum);
debug_printf("UpdateAddr 0x%08X Length 0x%08X Depositary 0x%08X Checksum 0x%08X\r\n", Update.WorkAddr, Update.Length, Update.Directory, Update.Checksum); debug_printf("UpdateAddr %p Length %p Depositary %p Checksum %p\r\n", Update.WorkAddr, Update.Length, Update.Directory, Update.Checksum);
debug_printf("PinConfig\r\n"); debug_printf("PinConfig\r\n");
if (AllPin.IsEff) if (AllPin.IsEff)

View File

@ -32,7 +32,7 @@ AT45DB::AT45DB(Spi* spi)
else else
{ {
PageSize = 256; PageSize = 256;
debug_printf("AT45DB Not Support 0x%08X\r\n", ID); debug_printf("AT45DB Not Support %p\r\n", ID);
} }
} }

View File

@ -270,7 +270,7 @@ bool SHT30::CheckStatus()
if(st != 0) if(st != 0)
{ {
uint sn = ReadSerialNumber(); uint sn = ReadSerialNumber();
debug_printf("SNum=0x%08X Status=0x%04X \r\n", sn, st); debug_printf("SNum=%p Status=0x%04X \r\n", sn, st);
debug_printf("Status=0x%04X \r\n", st); debug_printf("Status=0x%04X \r\n", st);
//if(rs.bit.ResetDetected) debug_printf(" RstDet"); // ResetDetected //if(rs.bit.ResetDetected) debug_printf(" RstDet"); // ResetDetected
//if(rs.bit.HeaterStatus) debug_printf(" HatSta"); // HeaterStatus //if(rs.bit.HeaterStatus) debug_printf(" HatSta"); // HeaterStatus

View File

@ -422,7 +422,7 @@ void DNS::Process(Buffer& bs, const IPEndPoint& server)
// 只要来自服务器的 // 只要来自服务器的
if(server.Address != _Socket->Remote.Address) return; if(server.Address != _Socket->Remote.Address) return;
//net_printf("DNS::Process [%d] = 0x%08X [%d] = 0x%08X \r\n", bs.Length(), bs.GetBuffer(), _Buffer->Length(), _Buffer->GetBuffer()); //net_printf("DNS::Process [%d] = %p [%d] = %p \r\n", bs.Length(), bs.GetBuffer(), _Buffer->Length(), _Buffer->GetBuffer());
//bs.Show(true); //bs.Show(true);
if(_Buffer) if(_Buffer)
*_Buffer = bs; *_Buffer = bs;
@ -433,7 +433,7 @@ void DNS::Process(Buffer& bs, const IPEndPoint& server)
server.Show(true); server.Show(true);
#endif #endif
} }
//net_printf("DNS::Process [%d] = 0x%08X \r\n", _Buffer->Length(), _Buffer->GetBuffer()); //net_printf("DNS::Process [%d] = %p \r\n", _Buffer->Length(), _Buffer->GetBuffer());
//_Buffer->Show(true); //_Buffer->Show(true);
} }

View File

@ -29,7 +29,7 @@ extern "C" {
static Heap g_Heap(heap, stack - heap); static Heap g_Heap(heap, stack - heap);
_Heap = &g_Heap; _Heap = &g_Heap;
mem_printf("Heap::Init(0x%08X, %d)\r\n", heap, stack - heap); mem_printf("Heap::Init(%p, %d)\r\n", heap, stack - heap);
} }
#if MEM_DEBUG #if MEM_DEBUG

View File

@ -270,7 +270,7 @@ void TSys::OnShowInfo() const
//debug_printf("\r\n"); //debug_printf("\r\n");
debug_printf("DevID:0x%04X RevID:0x%04X \r\n", DevID, RevID); debug_printf("DevID:0x%04X RevID:0x%04X \r\n", DevID, RevID);
debug_printf("CPUID:0x%08X", CPUID); debug_printf("CPUID:%p", CPUID);
if(cpu->Implementer == 0x41) debug_printf(" ARM:"); if(cpu->Implementer == 0x41) debug_printf(" ARM:");
if(cpu->Constant == 0x0C) if(cpu->Constant == 0x0C)
debug_printf(" ARMv6-M"); debug_printf(" ARMv6-M");
@ -296,7 +296,7 @@ void TSys::OnShowInfo() const
size = end - start; size = end - start;
debug_printf("Stack:(0x%08x, 0x%08x) = 0x%x (%dk)\r\n", start, end, size, size >> 10); debug_printf("Stack:(0x%08x, 0x%08x) = 0x%x (%dk)\r\n", start, end, size, size >> 10);
if(IsGD) debug_printf("ChipType:0x%08X %s\r\n", *(uint*)0x40022100, (cstring)0x40022100); if(IsGD) debug_printf("ChipType:%p %s\r\n", *(uint*)0x40022100, (cstring)0x40022100);
#endif #endif
} }

View File

@ -8,7 +8,7 @@ void TestAT45DB()
Spi spi(Spi2, 9000000, true); Spi spi(Spi2, 9000000, true);
_spi = &spi; _spi = &spi;
AT45DB sf(&spi); AT45DB sf(&spi);
debug_printf("AT45DB ID=0x%08X PageSize=%d\r\n", sf.ID, sf.PageSize); debug_printf("AT45DB ID=%p PageSize=%d\r\n", sf.ID, sf.PageSize);
int size = ArrayLength(Tx_Buffer); int size = ArrayLength(Tx_Buffer);
debug_printf("DataSize=%d\r\n", size); debug_printf("DataSize=%d\r\n", size);

View File

@ -170,7 +170,7 @@ int DevicesManagement::LoadDev()
debug_printf("\r\n"); debug_printf("\r\n");
} }
debug_printf("Load %d Dev from 0x%08X\r\n", i, cfg.Address); debug_printf("Load %d Dev from %p\r\n", i, cfg.Address);
byte len = DevArr.Count(); byte len = DevArr.Count();
debug_printf("Devices has %d Devs,LocalId :0x%02X\r\n", len,LocalId); debug_printf("Devices has %d Devs,LocalId :0x%02X\r\n", len,LocalId);
@ -215,7 +215,7 @@ void DevicesManagement::ClearDev()
Flash flash; Flash flash;
auto cfg = GetStore(flash); auto cfg = GetStore(flash);
debug_printf("DevicesManagement::ClearDevices Clear List 0x%08X \r\n", cfg.Address); debug_printf("DevicesManagement::ClearDevices Clear List %p \r\n", cfg.Address);
DevArr.DeleteAll().Clear(); DevArr.DeleteAll().Clear();

View File

@ -577,7 +577,7 @@ String& TokenStat::ToStr(String& str) const
{ {
TS("TokenStat::ToStr"); TS("TokenStat::ToStr");
/*debug_printf("this=0x%08X _Last=0x%08X _Total=0x%08X ", this, _Last, _Total); /*debug_printf("this=%p _Last=%p _Total=%p ", this, _Last, _Total);
Percent().Show(true);*/ Percent().Show(true);*/
if (SendRequest > 0) if (SendRequest > 0)
{ {