Browse Source

Add makeoptions to test various compile options.
Remove use of "error" in Baudcheck not-quite errors, to make searching test logs for actual errors easier.

WestfW 6 years ago
parent
commit
ea848cfc33

+ 1 - 1
optiboot/bootloaders/optiboot/baudcheck.c

@@ -48,7 +48,7 @@ ERR_TENTHS=$(( ERR_TS > 0 ? ERR_TS: -ERR_TS ))
 /*
  * Print a nice message containing the info we've calculated
  */
-echo BAUD RATE CHECK: Desired: $bps,  Real: $BAUD_ACTUAL, UBRRL = $BAUD_SETTING, Error=$BAUD_ERROR.$ERR_TENTHS\%
+echo BAUD RATE CHECK: Desired: $bps,  Real: $BAUD_ACTUAL, UBRRL = $BAUD_SETTING, Difference=$BAUD_ERROR.$ERR_TENTHS\%
 
 
 

+ 37 - 0
optiboot/bootloaders/optiboot/makeoptions

@@ -0,0 +1,37 @@
+#!/bin/bash
+make clean
+#
+
+# don't build most of the targets already in makeall
+
+# The "big three" standard bootloaders.
+# These need to be built AFTER the platforms, or they'll get renamed
+make atmega8
+make virboot8
+make atmega168
+make atmega328
+make virboot328
+
+make atmega328 BIGBOOT=1
+make atmega328 SUPPORT_EEPROM=1 LED_START_FLASHES=0 LED_START_ON=1
+make atmega328 BAUD_RATE=19200
+make atmega328 SOFT_UART=1
+make atmega328 LED_START_FLASHES=20
+
+make atmega1284 UART=1 LED=A1
+
+echo --------------------------------------------------
+echo        Expected to fail  !!!!
+echo --------------------------------------------------
+
+# too big
+make atmega328 SUPPORT_EEPROM=1
+# no such port
+make atmega328 LED=J1
+# no such led
+make atmega328 LED=fred
+make atmega328 UART=1
+#
+#invalid bit rates
+make atmega328 BAUD_RATE=300
+make atmega328 BAUD_RATE=3000000

+ 4 - 4
optiboot/bootloaders/optiboot/optiboot.c

@@ -321,16 +321,16 @@ typedef union {
 #if BAUD_ACTUAL <= BAUD_RATE
   #define BAUD_ERROR (( 100*(BAUD_RATE - BAUD_ACTUAL) ) / BAUD_RATE)
   #if BAUD_ERROR >= 5
-    #error BAUD_RATE error greater than -5%
+    #error BAUD_RATE off by greater than -5%
   #elif BAUD_ERROR >= 2
-    #warning BAUD_RATE error greater than -2%
+    #warning BAUD_RATE off by greater than -2%
   #endif
 #else
   #define BAUD_ERROR (( 100*(BAUD_ACTUAL - BAUD_RATE) ) / BAUD_RATE)
   #if BAUD_ERROR >= 5
-    #error BAUD_RATE error greater than 5%
+    #error BAUD_RATE off by greater than 5%
   #elif BAUD_ERROR >= 2
-    #warning BAUD_RATE error greater than 2%
+    #warning BAUD_RATE off by greater than 2%
   #endif
 #endif