]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Merge remote-tracking branch 'github/master' into not-linux
authorDan McGregor <dan.mcgregor@usask.ca>
Tue, 5 Jan 2016 16:08:14 +0000 (10:08 -0600)
committerDan McGregor <dan.mcgregor@usask.ca>
Tue, 5 Jan 2016 16:08:14 +0000 (10:08 -0600)
Debug/cli/cli.c
Scan/ISSILed/exampleAPI.bash
Scan/STLcd/bitmap2Struct.py
Scan/STLcd/exampleAPI.bash

index 149d12d49af22457731942f9d56582c791c1e672..5c83ee64c98ce4bf60a39c01b80d1f76a8110020 100644 (file)
@@ -159,15 +159,12 @@ void CLI_process()
                        }
                        else
                        {
-                       // Only do command-related stuff if there was actually a command
-                       // Avoids clogging command history with blanks
+                               // Add the command to the history
+                               CLI_saveHistory( CLILineBuffer );
 
                                // Process the current line buffer
                                CLI_commandLookup();
 
-                               // Add the command to the history
-                               CLI_saveHistory( CLILineBuffer );
-
                                // Keep the array circular, discarding the older entries
                                if ( CLIHistoryTail < CLIHistoryHead )
                                        CLIHistoryHead = ( CLIHistoryHead + 1 ) % CLIMaxHistorySize;
@@ -425,6 +422,11 @@ inline void CLI_saveHistory( char *buff )
                return;
        }
 
+        // Don't write empty lines to the history
+        const char *cursor = buff;
+        while (*cursor == ' ') { cursor++; } // advance past the leading whitespace
+        if (*cursor == '\0') { return ; }
+
        // Copy the line to the history
        int i;
        for (i = 0; i < CLILineBufferCurrent; i++)
index be869fa9c7f01590f25797cd2906b52e6cb51bae..7993c38cea2462094e3291fb7360e6c596df5360 100755 (executable)
@@ -3,9 +3,15 @@
 # Virtual Serial Port API Example
 # Jacob Alexander 2015
 
+if [ $# -eq 0 ]; then
+  echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)"
+  echo "  ex: $0 /dev/ttyACM0"
+  exit 1
+fi
 # XXX Set this to match your virtual serialport
-# TODO Show examples for Mac OSX and Cygwin/Windows
-SERIALPORT=/dev/ttyACM0
+# TODO Show examples for Cygwin/Windows
+# For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ)
+SERIALPORT=$1
 
 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer
 #       Generally this just means commands will get ignored
index dcf30c69b037bda8473d7735852787b4681705ba..6f2cbf128bf8c971766983c41485e2c234059774 100755 (executable)
@@ -19,7 +19,7 @@
 import sys
 
 from array import *
-from PIL import Image
+from PIL import Image # Use pillow instead of PIL, it works with Python 3
 
 
 # Convenience class to deal with converting images to a C array
@@ -110,7 +110,10 @@ class STLcdGraphic:
                return display
 
 
-filename = "ic_logo_lcd.bmp"
+filename = sys.argv[1]
+if filename is None:
+       print( "You must specify a bitmap filename. Try './bitmap2Struct.py ic_logo_lcd.bmp'" )
+       sys.exit( 1 )
 max_height = 32
 max_width = 128
 x_offset = 0
index c2a611e85b2c120141c6036ba395956744c7a18d..ae470b35f4ae6f169babce6f7ab97b90782de170 100755 (executable)
@@ -3,9 +3,15 @@
 # Virtual Serial Port API Example
 # Jacob Alexander 2015
 
+if [ $# -eq 0 ]; then
+  echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)"
+  echo "  ex: $0 /dev/ttyACM0"
+  exit 1
+fi
 # XXX Set this to match your virtual serialport
-# TODO Show examples for Mac OSX and Cygwin/Windows
-SERIALPORT=/dev/ttyACM0
+# TODO Show example for Cygwin/Windows
+# For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ)
+SERIALPORT=$1
 
 # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer
 #       Generally this just means commands will get ignored