shithub: m8c

Download patch

ref: 2e61bdb89a80d84475f81de711069624424cf355
parent: f9995781ebfd63edfa89088134d806434736ac30
author: Jonne Kokkonen <jonne.kokkonen@gmail.com>
date: Tue Apr 27 07:05:39 EDT 2021

remove unnecessary includes from main.c

--- a/main.c
+++ b/main.c
@@ -1,11 +1,7 @@
 #include <SDL2/SDL.h>
 #include <SDL2/SDL_timer.h>
-#include <errno.h>
 #include <libserialport.h>
 #include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
 
 #include "serial.h"
 
@@ -65,6 +61,7 @@
   // main loop
   while (run) {
 
+    //read serial port
     size_t bytes_read =
         sp_nonblocking_read(port, serial_buf, serial_read_size);
     if (bytes_read < 0) {
@@ -82,6 +79,7 @@
       }
     }
 
+    //get current inputs
     input_msg_s input = get_input_msg();
 
     switch (input.type) {
@@ -112,7 +110,8 @@
 
     render_screen();
 
-    usleep(10);
+    SDL_Delay(1);
+    
   }
 
   // exit, clean up
--