#include #include #include #include #include #include #include #include #include #include #include #include #include "main.h" #include "cmdopt.h" #include "error.h" #include "output.h" ///////////////////////////////////////////////////////////////////////////// extern int g_nVerbosity; ///////////////////////////////////////////////////////////////////////////// int GfaTfuPrintF(int verb, const char *pszFormat, ...) { if(verb <= g_nVerbosity) { int nRet; FILE *pf = (verb <= 1) ? stderr : stdout; va_list args; va_start(args, pszFormat); nRet = vfprintf(pf, pszFormat, args); fflush(pf); va_end(args); return nRet; } return 0; } ///////////////////////////////////////////////////////////////////////////// void GfaTfuDumpImageInfo(const char *pszContext, LPCGFA_IMG_INFO pii) { if( (g_nVerbosity >= 2) && pszContext && pii && (pii->nImgLength != 0xFFFFFFFF) && (pii->nImgCRC32 != 0xFFFFFFFF)) { TRACE2("%s Image Information:\n", pszContext); TRACE2(" Length: %u\n", pii->nImgLength); TRACE2(" CRC32: 0x%08X\n", pii->nImgCRC32); TRACE2(" Mat.Nr.: %s\n", pii->szImgMaterialNum); TRACE2(" Build: %s\n", pii->szImgNameBuild); } } ///////////////////////////////////////////////////////////////////////////// void GfaTfuOnDownloadStatus(const char *pszFile, int nLine, uint8_t nNodeAddr, uint32_t nFlashStartAddr, uint32_t nCbData, int nCtx, int nErrorCode) { UNUSED(pszFile); UNUSED(nLine); UNUSED(nNodeAddr); UNUSED(nFlashStartAddr); UNUSED(nCbData); UNUSED(nCtx); UNUSED(nErrorCode); } ///////////////////////////////////////////////////////////////////////////// void GfaTfuOnSendDataStatus(const char *pszFile, int nLine, uint8_t nNodeAddr, uint32_t nCbBlock, uint32_t nCbData, int nCtx, int nErrorCode) { UNUSED(pszFile); UNUSED(nLine); UNUSED(nNodeAddr); UNUSED(nCbBlock); UNUSED(nCbData); UNUSED(nCtx); UNUSED(nErrorCode); }