You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prawn_do/prawn_do.c
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -539,6 +539,9 @@ int main(){
539
539
// reset do_cmd_count to start_address
540
540
do_cmd_count=start_addr*2;
541
541
542
+
uint32_treps_error_count=0;
543
+
uint32_tlast_reps_error_idx=0;
544
+
542
545
// It takes 6 bytes to describe an instruction: 2 bytes for values, 4 bytes for time
543
546
uint32_tinst_per_buffer=SERIAL_BUFFER_SIZE / 6;
544
547
// In this loop, we read nearly full serial buffers and load them into do_cmds.
@@ -553,7 +556,9 @@ int main(){
553
556
| (serial_buf[6*i+3] << 8)
554
557
| serial_buf[6*i+2]);
555
558
if(reps<5&&reps!=0){
556
-
fast_serial_printf("Reps must be 0 or greater than 4, got %x\r\n", reps);
559
+
reps_error_count++;
560
+
last_reps_error_idx= (do_cmd_count+1) / 2;
561
+
reps=0;
557
562
}
558
563
if(reps!=0){
559
564
reps-=4;
@@ -577,7 +582,9 @@ int main(){
577
582
| (serial_buf[6*i+3] << 8)
578
583
| serial_buf[6*i+2]);
579
584
if(reps<5&&reps!=0){
580
-
fast_serial_printf("Reps must be 0 or greater than 4, got %x\r\n", reps);
585
+
reps_error_count++;
586
+
last_reps_error_idx= (do_cmd_count+1) / 2;
587
+
reps=0;
581
588
}
582
589
if(reps!=0){
583
590
reps-=4;
@@ -587,7 +594,12 @@ int main(){
587
594
}
588
595
}
589
596
590
-
fast_serial_printf("ok\r\n");
597
+
if(reps_error_count>0){
598
+
fast_serial_printf("Invalid number of reps in %d instructions, most recent error at instruction %d. Setting reps to zero for these instructions.\r\n", reps_error_count, last_reps_error_idx);
599
+
}
600
+
else{
601
+
fast_serial_printf("ok\r\n");
602
+
}
591
603
}
592
604
// Dump command: print the currently loaded buffered outputs
0 commit comments