Skip to content

Commit

Permalink
wip main: fixed get command prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
thegabriele97 committed Dec 21, 2021
1 parent c2d3cec commit b35f0be
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ static void txCpltCback(UART_HandleTypeDef *huart) {
send_etx--;
GAL_UART_Transmit_DMA(phcomm->SrcMemory.basePtr, send_etx == 1 ? phcomm->SrcMemory.size : 0xffff);
} else if (send_etx == 1) {
INVOKE_CB(phcomm->Callback.onUARTDownload, true);
buf[0] = '\n';
send_etx--;
GAL_UART_Transmit_DMA(&buf[0], 0x1);
INVOKE_CB(phcomm->Callback.onUARTDownload, true);
}

}
Expand Down Expand Up @@ -112,7 +110,7 @@ static void rxCpltCback(UART_HandleTypeDef *huart) {

send_etx = (phcomm->SrcMemory.size >> 16) + 1;
GAL_UART_Transmit_DMA(phcomm->SrcMemory.basePtr, send_etx == 1 ? phcomm->SrcMemory.size : 0xffff);
len = -4;
len = -1;

} else if (!strncmp((char *)buf, "help", 0x4)) {
strcpy((char *)buf, STR_HELP);
Expand All @@ -125,9 +123,6 @@ static void rxCpltCback(UART_HandleTypeDef *huart) {
}

strcpy((char *)(buf + buf_cnt + len + 1), STR_PROMPT);
// buf[buf_cnt + len + 1] = '\n';
// buf[buf_cnt + len + 2] = '>';
// buf[buf_cnt + len + 3] = ' ';
GAL_UART_Transmit_DMA(buf + buf_cnt, len + sizeof(STR_PROMPT));
buf_cnt = 0xff;
}
Expand Down

0 comments on commit b35f0be

Please sign in to comment.