Understanding main.h (Execute)
//Valid communication from USB?
if(cmd_ready_usb != 0)
{
cmd_ready_usb = 0;
//Cheap trick to get first line //ToDo: support more than 1
for(i = 0; i < PAYLOAD_BUF_LEN; i++)
{
tmp_rx_command_usb[i] = rx_command_usb[0][i];
}
//payload_parse_str() calls the functions (if valid)
result = payload_parse_str(tmp_rx_command_usb);
//LED:
if(result == PARSE_SUCCESSFUL)
{
//Green LED only if the ID matched and the command was known
new_cmd_led = 1;
}
}