From: Kevin Townsend <kevin@ktownsend.com>
Date: Mon, 9 Apr 2012 21:07:58 +0000 (+0200)
Subject: v1.1.0
X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/commitdiff_plain/f97bb0dca89e320ae0383f94d18c47f10f378787?ds=sidebyside

v1.1.0
---

diff --git a/ChangeLog.txt b/ChangeLog.txt
index 979788a..9f7f7da 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,4 +1,4 @@
-v1.1.0 - Ongoing
+v1.1.0 - 9 April 2012
 ==============================================================================
 BREAKING CHANGES
 ------------------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index 379faa6..3e5c335 100644
--- a/Makefile
+++ b/Makefile
@@ -70,7 +70,7 @@ OBJS += isl12022m.o
 
 # TFT LCD support
 VPATH += drivers/displays/tft drivers/displays/tft/hw 
-OBJS += drawing.o touchscreen.o colors.o bmp.o
+OBJS += drawing.o touchscreen.o colors.o theme.o bmp.o
 
 # GUI Controls
 VPATH += drivers/displays/tft/controls
diff --git a/build/codelite/LPC1343 Workspace.workspace.session b/build/codelite/LPC1343 Workspace.workspace.session
index 81974c2..b59e362 100644
--- a/build/codelite/LPC1343 Workspace.workspace.session	
+++ b/build/codelite/LPC1343 Workspace.workspace.session	
@@ -5,20 +5,20 @@
   <TabInfoArray Name="TabInfoArray">
     <TabInfo>
       <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
-      <int Value="5" Name="FirstVisibleLine"/>
+      <int Value="59" Name="FirstVisibleLine"/>
       <int Value="84" Name="CurrentLine"/>
       <wxArrayString Name="Bookmarks"/>
     </TabInfo>
     <TabInfo>
       <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" Name="FileName"/>
-      <int Value="623" Name="FirstVisibleLine"/>
-      <int Value="646" Name="CurrentLine"/>
+      <int Value="0" Name="FirstVisibleLine"/>
+      <int Value="0" Name="CurrentLine"/>
       <wxArrayString Name="Bookmarks"/>
     </TabInfo>
     <TabInfo>
       <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="FileName"/>
       <int Value="0" Name="FirstVisibleLine"/>
-      <int Value="14" Name="CurrentLine"/>
+      <int Value="6" Name="CurrentLine"/>
       <wxArrayString Name="Bookmarks"/>
     </TabInfo>
   </TabInfoArray>
diff --git a/build/codelite/LPC1343_CodeBase.project b/build/codelite/LPC1343_CodeBase.project
index ad75d70..10d1983 100644
--- a/build/codelite/LPC1343_CodeBase.project
+++ b/build/codelite/LPC1343_CodeBase.project
@@ -168,10 +168,6 @@
           <File Name="../../drivers/displays/tft/fonts/verdanabold14.c"/>
           <File Name="../../drivers/displays/tft/fonts/verdanabold14.h"/>
         </VirtualDirectory>
-        <VirtualDirectory Name="dialogues">
-          <File Name="../../drivers/displays/tft/dialogues/alphanumeric.c"/>
-          <File Name="../../drivers/displays/tft/dialogues/alphanumeric.h"/>
-        </VirtualDirectory>
         <File Name="../../drivers/displays/tft/bmp.c"/>
         <File Name="../../drivers/displays/tft/bmp.h"/>
         <File Name="../../drivers/displays/tft/colors.h"/>
@@ -201,6 +197,22 @@
           <VirtualDirectory Name="aa4"/>
         </VirtualDirectory>
         <File Name="../../drivers/displays/tft/colors.c"/>
+        <VirtualDirectory Name="controls">
+          <File Name="../../drivers/displays/tft/controls/button.c"/>
+          <File Name="../../drivers/displays/tft/controls/button.h"/>
+          <File Name="../../drivers/displays/tft/controls/hsbchart.c"/>
+          <File Name="../../drivers/displays/tft/controls/hsbchart.h"/>
+          <File Name="../../drivers/displays/tft/controls/huechart.c"/>
+          <File Name="../../drivers/displays/tft/controls/huechart.h"/>
+          <File Name="../../drivers/displays/tft/controls/label.c"/>
+          <File Name="../../drivers/displays/tft/controls/label.h"/>
+          <File Name="../../drivers/displays/tft/controls/labelcentered.c"/>
+          <File Name="../../drivers/displays/tft/controls/labelcentered.h"/>
+          <File Name="../../drivers/displays/tft/controls/progressbar.c"/>
+          <File Name="../../drivers/displays/tft/controls/progressbar.h"/>
+        </VirtualDirectory>
+        <File Name="../../drivers/displays/tft/theme.c"/>
+        <File Name="../../drivers/displays/tft/theme.h"/>
       </VirtualDirectory>
       <VirtualDirectory Name="bitmap">
         <VirtualDirectory Name="st7565">
diff --git a/build/crossworks/LPC1343_CodeBase.hzp b/build/crossworks/LPC1343_CodeBase.hzp
index c05e75e..b58252b 100644
--- a/build/crossworks/LPC1343_CodeBase.hzp
+++ b/build/crossworks/LPC1343_CodeBase.hzp
@@ -236,6 +236,7 @@
               <file file_name="../../drivers/displays/tft/controls/label.c"/>
               <file file_name="../../drivers/displays/tft/controls/labelcentered.c"/>
             </folder>
+            <file file_name="../../drivers/displays/tft/theme.c"/>
           </folder>
           <folder Name="character">
             <folder Name="samsung_20T202DA2JA">
@@ -415,5 +416,5 @@
   <configuration Name="Debug" build_debug_information="Yes" c_preprocessor_definitions="DEBUG" gcc_optimization_level="None" hidden="Yes" link_include_startup_code="No"/>
   <configuration Name="THUMB Flash Release" inherited_configurations="THUMB;Flash;Release"/>
   <configuration Name="Release" build_debug_information="No" build_remove_unused_symbols="Yes" c_additional_options="-g1" c_preprocessor_definitions="NDEBUG;STARTUP_FROM_RESET" gcc_optimization_level="Optimize For Size" hidden="Yes" link_include_startup_code="No"/>
-  <configuration Name="Common" arm_linker_allow_multiple_definition="Yes" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/"/>
+  <configuration Name="Common" arm_gcc_target="arm-unknown-eabi" arm_library_optimization="Small" arm_linker_allow_multiple_definition="Yes" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/"/>
 </solution>
diff --git a/build/crossworks/LPC1343_CodeBase.hzs b/build/crossworks/LPC1343_CodeBase.hzs
index e77a2dd..430ec20 100644
--- a/build/crossworks/LPC1343_CodeBase.hzs
+++ b/build/crossworks/LPC1343_CodeBase.hzs
@@ -27,7 +27,7 @@
   <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers" name="unnamed" />
   <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays" name="unnamed" />
   <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays;tft" name="unnamed" />
-  <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;project" name="unnamed" />
+  <ProjectSessionItem path="LPC1343_CodeBase;LPC1343_CodeBase;Source Files;drivers;displays;tft;controls" name="unnamed" />
  </Project>
  <Register1>
   <RegisterWindow openNodes="GPIO2" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU;CoreDebug;GPIO2" decimalNodes="" octalNodes="" asciiNodes="" />
@@ -63,8 +63,7 @@
   <Watches active="0" update="Never" />
  </Watch4>
  <Files>
-  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" y="554" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" left="0" selected="0" name="unnamed" top="507" />
-  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="175" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="147" />
+  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="27" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="42" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="30" />
  </Files>
- <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="SEGGER J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\displays\tft\controls" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
+ <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="SEGGER J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\drivers\displays\tft" fileDialogDefaultFilter="" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
 </session>
diff --git a/core/ssp/ssp.c b/core/ssp/ssp.c
index 284945c..b6beef2 100644
--- a/core/ssp/ssp.c
+++ b/core/ssp/ssp.c
@@ -2,8 +2,6 @@
 /*! 
     @file     ssp.c
     @author   K. Townsend (microBuilder.eu)
-    @date     22 March 2010
-    @version  0.10
 
     @section DESCRIPTION
 
@@ -40,7 +38,7 @@
 
     Software License Agreement (BSD License)
 
-    Copyright (c) 2010, microBuilder SARL
+    Copyright (c) 2012, K. Townsend
     All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
@@ -181,7 +179,7 @@ void sspInit (uint8_t portNum, sspClockPolarity_t polarity, sspClockPhase_t phas
     gpioSetValue(SSP0_CSPORT, SSP0_CSPIN, 1);
     gpioSetPullup(&IOCON_PIO0_2, gpioPullupMode_Inactive);  // Board has external pull-up
   
-    /* If SSP0CLKDIV = DIV1 -- (PCLK / (CPSDVSR × [SCR+1])) = (72,000,000 / (2 x [8 + 1])) = 4.0 MHz */
+    /* If SSP0CLKDIV = DIV1 -- (PCLK / (CPSDVSR � [SCR+1])) = (72,000,000 / (2 x [8 + 1])) = 4.0 MHz */
     uint32_t configReg = ( SSP_SSP0CR0_DSS_8BIT   // Data size = 8-bit
                   | SSP_SSP0CR0_FRF_SPI           // Frame format = SPI
                   | SSP_SSP0CR0_SCR_8);           // Serial clock rate = 8
diff --git a/drivers/displays/tft/theme.h b/drivers/displays/tft/theme.h
index a8758e3..e2a3e78 100644
--- a/drivers/displays/tft/theme.h
+++ b/drivers/displays/tft/theme.h
@@ -86,18 +86,6 @@ typedef struct theme_s
   uint16_t colorFillAlt;                    // Slightly lighter or darker fill for window and control backgrounds
 } theme_t;
 
-// Grayscale Theme (Default Setting)
-theme_t themeGrayscale =                  { COLOR_WHITE,                  // Background Color
-                                            COLOR_GRAY_128,               // Border Color
-                                            COLOR_GRAY_80,                // Border Darker
-                                            COLOR_BLACK,                  // Text Color
-                                            COLOR_GRAY_50,                // Alt. Text Color
-                                            COLOR_GRAY_200,               // Fill (Normal)
-                                            COLOR_GRAY_225 };             // Fill (Alternate)
-
-// Default theme
-#define THEME_DEFAULT                       themeGrayscale
-
 // Default font
 #if CFG_TFTLCD_USEAAFONTS
   #define THEME_FONT                        DejaVuSansCondensedBold14_AA2
@@ -105,4 +93,6 @@ theme_t themeGrayscale =                  { COLOR_WHITE,                  // Bac
   #define THEME_FONT                        dejaVuSans9ptFontInfo
 #endif
 
-#endif
\ No newline at end of file
+theme_t themeGetDefault(void);
+
+#endif
diff --git a/drivers/displays/tft/touchscreen.c b/drivers/displays/tft/touchscreen.c
index 6e31824..1ac7821 100644
--- a/drivers/displays/tft/touchscreen.c
+++ b/drivers/displays/tft/touchscreen.c
@@ -170,7 +170,7 @@ uint32_t tsReadY(void)
 /**************************************************************************/
 void tsCalibCenterText(char* text, uint16_t y, uint16_t color)
 {
-  labelcenteredRender(lcdGetWidth()/2, y, COLOR_WHITE, color, text, THEME_DEFAULT);
+  labelcenteredRender(lcdGetWidth()/2, y, COLOR_WHITE, color, text, themeGetDefault());
 }
 
 /**************************************************************************/
diff --git a/main.c b/main.c
index ba5cd42..bb2c280 100644
--- a/main.c
+++ b/main.c
@@ -33,11 +33,6 @@
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 /**************************************************************************/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
 #include "projectconfig.h"
 #include "sysinit.h"
 
diff --git a/project/commands/drawing/cmd_button.c b/project/commands/drawing/cmd_button.c
index bfa321b..9af4310 100644
--- a/project/commands/drawing/cmd_button.c
+++ b/project/commands/drawing/cmd_button.c
@@ -74,7 +74,7 @@ void cmd_button(uint8_t argc, char **argv)
   if (argc == 5)
   {
     // Render the button with no text
-    buttonRender(x, y, w, h, (uint16_t)fontcolor, NULL, THEME_DEFAULT);
+    buttonRender(x, y, w, h, (uint16_t)fontcolor, NULL, themeGetDefault());
   }
   else
   {
@@ -91,7 +91,7 @@ void cmd_button(uint8_t argc, char **argv)
     *data_ptr++ = '\0';
 
     // Render the button with text
-    buttonRender(x, y, w, h, (uint16_t)fontcolor, (char *)&data, THEME_DEFAULT);
+    buttonRender(x, y, w, h, (uint16_t)fontcolor, (char *)&data, themeGetDefault());
   }
 }
 
diff --git a/project/commands/drawing/cmd_progress.c b/project/commands/drawing/cmd_progress.c
index a8b9e56..dbd5dec 100644
--- a/project/commands/drawing/cmd_progress.c
+++ b/project/commands/drawing/cmd_progress.c
@@ -77,7 +77,7 @@ void cmd_progress(uint8_t argc, char **argv)
   }
 
   // Draw the progress bar (always use rounded corners for simplicity sake)
-  progressbarRender(x, y, w, h, percent, progressfill, THEME_DEFAULT);
+  progressbarRender(x, y, w, h, percent, progressfill, themeGetDefault());
 }
 
 #endif  
diff --git a/projectconfig.h b/projectconfig.h
index f0fc30c..449cc59 100644
--- a/projectconfig.h
+++ b/projectconfig.h
@@ -782,6 +782,13 @@
                               addition to CFG_INTERFACE_ENABLEIRQ if
                               this is also enabled.  The character used
                               is defined below.
+    CFG_INTERFACE_LONGSYSINFO If this is set to 1 extra information will
+                              be included in the Sys Info ('V') command
+                              on the CLI. This can be useful when trying
+                              to debug problems on remote HW, or with 
+                              unknown firmware.  It will also use about
+                              0.5KB flash, though, so only enable it is
+                              necessary.
 
     NOTE:                     The command-line interface will use either
                               USB-CDC or UART depending on whether
@@ -799,6 +806,7 @@
       #define CFG_INTERFACE_IRQPIN        (7)
       #define CFG_INTERFACE_SHORTERRORS   (0)
       #define CFG_INTERFACE_CONFIRMREADY  (0)
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 
     #ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
@@ -812,6 +820,7 @@
       #define CFG_INTERFACE_IRQPIN        (7)
       #define CFG_INTERFACE_SHORTERRORS   (0)
       #define CFG_INTERFACE_CONFIRMREADY  (0)
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 
     #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
@@ -829,6 +838,7 @@
       #define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS       ">"
       #define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS        "<"
       #define CFG_INTERFACE_CONFIRMREADY_TEXT             "."
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 
     #ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
@@ -846,6 +856,7 @@
       #define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS       ">"
       #define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS        "<"
       #define CFG_INTERFACE_CONFIRMREADY_TEXT             "."
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 
     #ifdef CFG_BRD_LPC1343_802154USBSTICK
@@ -859,6 +870,7 @@
       #define CFG_INTERFACE_IRQPIN        (7)
       #define CFG_INTERFACE_SHORTERRORS   (0)
       #define CFG_INTERFACE_CONFIRMREADY  (0)
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 	
     #ifdef CFG_BRD_LPC1343_OLIMEX_P
@@ -872,6 +884,7 @@
       #define CFG_INTERFACE_IRQPIN        (7)
       #define CFG_INTERFACE_SHORTERRORS   (0)
       #define CFG_INTERFACE_CONFIRMREADY  (0)
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 
     #ifdef CFG_BRD_LPC1343_LPCXPRESSO
@@ -885,6 +898,7 @@
       #define CFG_INTERFACE_IRQPIN        (7)
       #define CFG_INTERFACE_SHORTERRORS   (0)
       #define CFG_INTERFACE_CONFIRMREADY  (0)
+      #define CFG_INTERFACE_LONGSYSINFO   (0)
     #endif
 /*=========================================================================*/
 
@@ -1160,7 +1174,7 @@
     #ifdef CFG_BRD_LPC1343_REFDESIGN
       // #define CFG_TFTLCD
       #define CFG_TFTLCD_INCLUDESMALLFONTS   (0)
-      #define CFG_TFTLCD_USEAAFONTS          (1)
+      #define CFG_TFTLCD_USEAAFONTS          (0)
       #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
       #define CFG_TFTLCD_TS_KEYPADDELAY      (100)
     #endif
@@ -1176,7 +1190,7 @@
     #if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
       #define CFG_TFTLCD
       #define CFG_TFTLCD_INCLUDESMALLFONTS   (0)
-      #define CFG_TFTLCD_USEAAFONTS          (1)
+      #define CFG_TFTLCD_USEAAFONTS          (0)
       #define CFG_TFTLCD_TS_DEFAULTTHRESHOLD (50)
       #define CFG_TFTLCD_TS_KEYPADDELAY      (100)
     #endif