zmodem: Fix the build break and warning for host binary
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: If6b324c20fcb245633f3bdc9000bc48f581c7dc6
This commit is contained in:
parent
8f18b23352
commit
d28dcfbee3
@ -59,8 +59,7 @@ ZMODEM = $(APPDIR)/system/zmodem
|
|||||||
HOSTDIR = $(ZMODEM)/host
|
HOSTDIR = $(ZMODEM)/host
|
||||||
HOSTAPPS = $(ZMODEM)/host/apps
|
HOSTAPPS = $(ZMODEM)/host/apps
|
||||||
|
|
||||||
HOSTCFLAGS += -isystem $(HOSTDIR) -I $(ZMODEM) -I $(HOSTAPPS)
|
HOSTCFLAGS += -I $(HOSTDIR) -I $(HOSTAPPS)
|
||||||
HOSTCFLAGS += -Dsz_main=main -Drz_main=main
|
|
||||||
ifeq ($(CONFIG_DEBUG_FEATURES),y)
|
ifeq ($(CONFIG_DEBUG_FEATURES),y)
|
||||||
HOSTCFLAGS += -DCONFIG_DEBUG_ZMODEM=1
|
HOSTCFLAGS += -DCONFIG_DEBUG_ZMODEM=1
|
||||||
endif
|
endif
|
||||||
|
@ -234,12 +234,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_ZMODEM
|
#ifdef CONFIG_DEBUG_ZMODEM
|
||||||
# define zmprintf(format, ...) _info
|
# define zmprintf(format, ...) syslog(LOG_INFO, format, ##__VA_ARGS__)
|
||||||
# define zmdbg(format, ...) _info
|
# define zmdbg(format, ...) syslog(LOG_INFO, EXTRA_FMT format EXTRA_ARG, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# undef CONFIG_SYSTEM_ZMODEM_DUMPBUFFER
|
# undef CONFIG_SYSTEM_ZMODEM_DUMPBUFFER
|
||||||
# define zmprintf _none
|
# define zmprintf(x...)
|
||||||
# define zmdbg _none
|
# define zmdbg(x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -49,10 +49,6 @@
|
|||||||
|
|
||||||
#include "zm.h"
|
#include "zm.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Pre-processor Definitions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -69,8 +65,6 @@
|
|||||||
* CAN characters if they are received by a command interpreter.
|
* CAN characters if they are received by a command interpreter.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CANISTR_SIZE (8+10)
|
|
||||||
|
|
||||||
const uint8_t g_canistr[CANISTR_SIZE] =
|
const uint8_t g_canistr[CANISTR_SIZE] =
|
||||||
{
|
{
|
||||||
/* Eight CAN characters */
|
/* Eight CAN characters */
|
||||||
@ -85,7 +79,7 @@ const uint8_t g_canistr[CANISTR_SIZE] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Protypes
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -199,7 +193,7 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
term = ZCRCW;
|
term = ZCRCW;
|
||||||
zmdbg("zbin=%c, buflen=%d, term=%c flags=%04x\n",
|
zmdbg("zbin=%c, buflen=%zu, term=%c flags=%04x\n",
|
||||||
zbin, buflen, term, pzm->flags);
|
zbin, buflen, term, pzm->flags);
|
||||||
|
|
||||||
/* Transfer the data to the I/O buffer, accumulating the CRC */
|
/* Transfer the data to the I/O buffer, accumulating the CRC */
|
||||||
@ -226,7 +220,7 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer,
|
|||||||
|
|
||||||
if (zbin == ZBIN)
|
if (zbin == ZBIN)
|
||||||
{
|
{
|
||||||
crc = (uint32_t)crc16part((FAR const uint8_t *)&term, 1, (uint16_t)crc);
|
crc = crc16part((FAR const uint8_t *)&term, 1, crc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -265,7 +259,7 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer,
|
|||||||
* necessary.
|
* necessary.
|
||||||
*
|
*
|
||||||
* Hex header:
|
* Hex header:
|
||||||
* ZPAD ZPAD ZDLE ZHEX type f3/p0 f2/p1 f1/p2 f0/p3 crc-1 crc-2 CR LF [XON]
|
* ZPAD ZPAD ZDLE ZHEX type f3/p0 f2/p1 f1/p2 f0/p3 crc1 crc2 CR LF [XON]
|
||||||
* Payload length: 16 (14 hex digits, cr, lf, ignoring optional XON)
|
* Payload length: 16 (14 hex digits, cr, lf, ignoring optional XON)
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@ -312,7 +306,6 @@ int zm_sendhexhdr(FAR struct zm_state_s *pzm, int type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* crc-1 crc-2 */
|
/* crc-1 crc-2 */
|
||||||
/* REVISIT: Should this be zm_putzdle()? */
|
|
||||||
|
|
||||||
ptr = zm_puthex8(ptr, (crc >> 8) & 0xff);
|
ptr = zm_puthex8(ptr, (crc >> 8) & 0xff);
|
||||||
ptr = zm_puthex8(ptr, crc & 0xff);
|
ptr = zm_puthex8(ptr, crc & 0xff);
|
||||||
@ -443,7 +436,7 @@ int zm_sendbin32hdr(FAR struct zm_state_s *pzm, int type,
|
|||||||
/* type */
|
/* type */
|
||||||
|
|
||||||
ptr = zm_putzdle(pzm, ptr, type);
|
ptr = zm_putzdle(pzm, ptr, type);
|
||||||
crc = crc32part((FAR const uint8_t *)&type, 1, 0xffffffffL);
|
crc = crc32part((FAR const uint8_t *)&type, 1, 0xffffffffl);
|
||||||
|
|
||||||
/* f3/p0 f2/p1 f1/p2 f0/p3 */
|
/* f3/p0 f2/p1 f1/p2 f0/p3 */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user