|
@@ -353,10 +353,13 @@ shellmatta_retCode_t shellmatta_ymodem_init(shellmatta_handle_t hand
|
|
|
&& (NULL != recvPacketCallback)
|
|
|
&& (NULL != transmissionCompleteCallback))
|
|
|
{
|
|
|
+
|
|
|
+ (void)memset((void *)&inst->ymodem, 0, sizeof(shellmatta_ymodem_t));
|
|
|
+
|
|
|
/** -# use instances buffer if no buffer is given */
|
|
|
if(NULL == recvBuffer)
|
|
|
{
|
|
|
- if(inst->bufferSize <= YMODEM_PACKET_SIZE_1K)
|
|
|
+ if(inst->bufferSize < YMODEM_PACKET_SIZE_1K)
|
|
|
{
|
|
|
/** -# return use fault if buffer is too small */
|
|
|
ret = SHELLMATTA_USE_FAULT;
|
|
@@ -366,11 +369,10 @@ shellmatta_retCode_t shellmatta_ymodem_init(shellmatta_handle_t hand
|
|
|
inst->ymodem.packet.packetData = (uint8_t*)inst->buffer;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- (void)memset((void *)&inst->ymodem, 0, sizeof(shellmatta_ymodem_t));
|
|
|
-
|
|
|
- /** -# store buffer */
|
|
|
- inst->ymodem.packet.packetData = recvBuffer;
|
|
|
+ else {
|
|
|
+ /** -# store buffer */
|
|
|
+ inst->ymodem.packet.packetData = recvBuffer;
|
|
|
+ }
|
|
|
|
|
|
/** -# init callbacks */
|
|
|
inst->ymodem.cancelCallback = cancelCallback;
|