From 9aed5d7e7b3c7bf09da712e9c272ece401a7acc9 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期一, 25 十一月 2024 14:51:23 +0800 Subject: [PATCH] add UltraSonic and MultiWireLess --- ComLib/Src/KMachine.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ComLib/Src/KMachine.c b/ComLib/Src/KMachine.c index 54c8235..b053452 100644 --- a/ComLib/Src/KMachine.c +++ b/ComLib/Src/KMachine.c @@ -128,8 +128,8 @@ int nMaxCurTime=0; volatile int PowerState = 0; -volatile int PowerDownEvent=0; -volatile int OldPowerDownEvent=0; +volatile int PowerDownFlag=0; +volatile int OldPowerDownFlag=1; volatile int OldPowerDownEventTime=0; int nMaxRunStatIndex=-1; unsigned int nMaxRunStatSeq=0; @@ -245,15 +245,16 @@ int ReadFlashMem(void * pBuf, void * pAddrFlash, int nByteSize) { -// memcpy(pBuf,pAddrFlash,nSize); - for (int i=0;i<nByteSize/4;i++) - { - ((uint32_t *)pBuf)[i] = ((uint32_t *)pAddrFlash)[i]; - } - for (int i=nByteSize/4*2;i<nByteSize/2;i++) - { - ((uint16_t *)pBuf)[i] = ((uint16_t *)pAddrFlash)[i]; - } + memcpy(pBuf,pAddrFlash,nByteSize); +// for (int i=0;i<nByteSize/4;i++) +// { +// ((uint32_t *)pBuf)[i] = ((uint32_t *)pAddrFlash)[i]; +// } +// for (int i=nByteSize/4*2;i<nByteSize/2;i++) +// { +// ((uint16_t *)pBuf)[i] = ((uint16_t *)pAddrFlash)[i]; +// } + return nByteSize; } -- Gitblit v1.9.1