return PM3_SUCCESS on usart_writebuffer_sync, usb_write

This commit is contained in:
Philippe Teuwen 2019-04-22 22:58:45 +02:00
commit b0eef756c1
8 changed files with 33 additions and 33 deletions

View file

@ -1201,8 +1201,8 @@ static void PacketReceived(PacketCommandNG *packet) {
for (size_t i = 0; i < numofbytes; i += USB_CMD_DATA_SIZE) {
size_t len = MIN((numofbytes - i), USB_CMD_DATA_SIZE);
int16_t result = reply_old(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, i, len, BigBuf_get_traceLen(), mem + startidx + i, len);
if (result <= 0)
int result = reply_old(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K, i, len, BigBuf_get_traceLen(), mem + startidx + i, len);
if (result != PM3_SUCCESS)
Dbprintf("transfer to client failed :: | bytes between %d - %d (%d) | result: %d", i, i + len, len, result);
}
// Trigger a finish downloading signal with an ACK frame
@ -1245,8 +1245,8 @@ static void PacketReceived(PacketCommandNG *packet) {
for (size_t i = 0; i < numofbytes; i += USB_CMD_DATA_SIZE) {
len = MIN((numofbytes - i), USB_CMD_DATA_SIZE);
int16_t result = reply_old(CMD_DOWNLOADED_EML_BIGBUF, i, len, 0, mem + startidx + i, len);
if (result <= 0)
int result = reply_old(CMD_DOWNLOADED_EML_BIGBUF, i, len, 0, mem + startidx + i, len);
if (result != PM3_SUCCESS)
Dbprintf("transfer to client failed :: | bytes between %d - %d (%d) | result: %d", i, i + len, len, result);
}
// Trigger a finish downloading signal with an ACK frame
@ -1570,7 +1570,7 @@ void __attribute__((noreturn)) AppMain(void) {
// Check if there is a packet available
PacketCommandNG rx;
int16_t ret = receive_ng(&rx);
int ret = receive_ng(&rx);
if (ret == PM3_SUCCESS) {
PacketReceived(&rx);
} else if (ret != PM3_ENODATA) {