still a lot of bugs

This commit is contained in:
eddyem
2023-04-23 19:28:52 +03:00
parent 4f0a3a0429
commit b9cb9f6428
17 changed files with 643 additions and 238 deletions

View File

@@ -16,8 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hardware.h"
#include "cmdproto.h"
#include "debug.h"
#include "hardware.h"
#include "usart.h"
#include "usb.h"
@@ -48,11 +49,14 @@ int main(void){
if(Tms - ctr > 499){
ctr = Tms;
pin_toggle(GPIOB, 1 << 1 | 1 << 0); // toggle LED @ PB0
//DBG("blink\n");
}
int l = USB_receivestr(CMD_IDX, inbuff, MAXSTRLEN);
if(l < 0) USB_sendstr(CMD_IDX, "ERROR: USB buffer overflow or string was too long\n");
else if(l){
parse_cmd(inbuff);
}
l = USB_receivestr(DBG_IDX, inbuff, MAXSTRLEN);
if(l) USB_sendstr(DBG_IDX, inbuff); // just echo back all from USB-DBG interface
}
}