Updated to v0.95
authorKevin Townsend <kevin@ktownsend.com>
Wed, 3 Aug 2011 19:25:40 +0000 (21:25 +0200)
committerKevin Townsend <kevin@ktownsend.com>
Wed, 3 Aug 2011 19:25:40 +0000 (21:25 +0200)
17 files changed:
ChangeLog.txt
Makefile
build/codelite/LPC1343 Workspace.tags
build/codelite/LPC1343 Workspace.workspace.session
build/codelite/LPC1343_CodeBase.project
build/crossworks/LPC1343_CodeBase.hzp
build/crossworks/LPC1343_CodeBase.hzs
core/cpu/cpu.c
core/usbcdc/usbcore.c
drivers/lcd/tft/drawing.c
drivers/lcd/tft/hw/ILI9325.c
drivers/lcd/tft/hw/ILI9328.c
drivers/lcd/tft/touchscreen.c
drivers/rtc/isl12022m/isl12022m.c
lpc134x.h
projectconfig.h
tools/dotfactory/OutputConfigs.xml

index 96d9ba5..f638087 100644 (file)
@@ -1,6 +1,23 @@
-v0.9.3 - Ongoing
-================
+v0.9.5 - 3 August 2011
+======================
 
+- Redid the font rendering code to use DotFactory
+  generated fonts, and update to the latest binary
+  in the /tools folder.  All fonts have been
+  re-rendered to accomodate the updated code.
+- Updated clock values in cpu.c for PLL to match FCCO 
+  range of 156-320MHz
+- Changed SCB_PLLCTRL_MULT_* to SCB_PLLCTRL_MSEL_* in
+  lpc111x.h to match usermanual
+- Changed SCB_PLLCTRL_DIV_* SCB_PLLCTRL_PSEL_* in
+  lpc111x.h to match usermanual
+- Added inline version of key functions in ili9328.c,
+  which increases the code size ~1.3KB but more than
+  doubles the drawing speed for most drawing functions
+  by avoiding branch operations and pushing and popping
+  the stack multiple times.  Inline methods can be
+  toggled with 'ILI9238_USE_INLINE_METHODS'.
+- Fixed IOCON_SWDIO_PIO1_3_FUNC_CT32B1_MAT2 in lpc134x.h
 - Added drawCornerFilled() to drawing.c and LCD CLI
 - Fixed a nasty bug with 'gpioInterruptEvent' in the 
   gpioSetInterrupt function (core/gpio/gpio.c)
index ef0296a..0da6100 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -60,7 +60,7 @@ VPATH += drivers/lcd/tft/dialogues
 OBJS += drawing.o touchscreen.o bmp.o alphanumeric.o
 OBJS += dejavusans9.o dejavusansbold9.o dejavusanscondensed9.o
 OBJS += dejavusansmono8.o dejavusansmonobold8.o
-OBJS += veramono9.o veramonobold9.o veramono11.o veramonobold11.o 
+OBJS += verdana9.o verdana14.o verdanabold14.o 
 
 # LCD Driver (Only one can be included at a time!)
 OBJS += ILI9328.o
index 0006aac..9773273 100644 (file)
Binary files a/build/codelite/LPC1343 Workspace.tags and b/build/codelite/LPC1343 Workspace.tags differ
index 6d56121..3fd69dd 100644 (file)
@@ -1,24 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Session Name="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace">
-  <int Value="2" Name="m_selectedTab"/>
+  <int Value="1" Name="m_selectedTab"/>
   <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\build\codelite\LPC1343 Workspace.workspace" Name="m_workspaceName"/>
   <TabInfoArray Name="TabInfoArray">
     <TabInfo>
       <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" Name="FileName"/>
-      <int Value="2" Name="FirstVisibleLine"/>
-      <int Value="19" Name="CurrentLine"/>
-      <wxArrayString Name="Bookmarks"/>
-    </TabInfo>
-    <TabInfo>
-      <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\core\usbcdc\usbcore.c" Name="FileName"/>
-      <int Value="159" Name="FirstVisibleLine"/>
-      <int Value="178" Name="CurrentLine"/>
+      <int Value="50" Name="FirstVisibleLine"/>
+      <int Value="41" Name="CurrentLine"/>
       <wxArrayString Name="Bookmarks"/>
     </TabInfo>
     <TabInfo>
       <wxString Value="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\Makefile" Name="FileName"/>
-      <int Value="18" Name="FirstVisibleLine"/>
-      <int Value="29" Name="CurrentLine"/>
+      <int Value="54" Name="FirstVisibleLine"/>
+      <int Value="63" Name="CurrentLine"/>
       <wxArrayString Name="Bookmarks"/>
     </TabInfo>
   </TabInfoArray>
index b5f9df1..1deddee 100644 (file)
           <File Name="../../drivers/lcd/tft/hw/st7783.h"/>
           <File Name="../../drivers/lcd/tft/hw/st7735.c"/>
           <File Name="../../drivers/lcd/tft/hw/st7735.h"/>
+          <File Name="../../drivers/lcd/tft/hw/ILI9328.c"/>
+          <File Name="../../drivers/lcd/tft/hw/ILI9328.h"/>
+          <File Name="../../drivers/lcd/tft/hw/ssd1331.c"/>
+          <File Name="../../drivers/lcd/tft/hw/ssd1331.h"/>
         </VirtualDirectory>
         <VirtualDirectory Name="fonts">
           <File Name="../../drivers/lcd/tft/fonts/bitmapfonts.h"/>
           <File Name="../../drivers/lcd/tft/fonts/dejavusansmono8.h"/>
           <File Name="../../drivers/lcd/tft/fonts/dejavusansmonobold8.c"/>
           <File Name="../../drivers/lcd/tft/fonts/dejavusansmonobold8.h"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramono9.c"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramono9.h"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramono11.c"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramono11.h"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramonobold9.c"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramonobold9.h"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramonobold11.c"/>
-          <File Name="../../drivers/lcd/tft/fonts/veramonobold11.h"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdana9.c"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdana9.h"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdana14.c"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdana14.h"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdanabold14.c"/>
+          <File Name="../../drivers/lcd/tft/fonts/verdanabold14.h"/>
         </VirtualDirectory>
         <File Name="../../drivers/lcd/tft/drawing.c"/>
         <File Name="../../drivers/lcd/tft/drawing.h"/>
     </VirtualDirectory>
   </VirtualDirectory>
   <Settings Type="Dynamic Library">
+    <GlobalSettings>
+      <Compiler Options="" C_Options="">
+        <IncludePath Value="."/>
+      </Compiler>
+      <Linker Options="">
+        <LibraryPath Value="."/>
+      </Linker>
+      <ResourceCompiler Options=""/>
+    </GlobalSettings>
     <Configuration Name="Debug" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="-g" Required="yes" PreCompiledHeader="">
+      <Compiler Options="-g" C_Options="-g" Required="yes" PreCompiledHeader="">
         <IncludePath Value="."/>
       </Compiler>
       <Linker Options="" Required="yes"/>
       <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="" IntermediateDirectory="./Debug" Command="" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <General OutputFile="" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
       <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;"/>
       <Debugger IsRemote="yes" RemoteHostName="localhost" RemoteHostPort="2331" DebuggerPath="arm-none-eabi-gdb.exe">
         <PostConnectCommands># Make sure that we are using SWD
 monitor interface SWD
-
 # Set monitor to little endian
 monitor endian little
-
 # Set monitor speed
 monitor speed 1000
-
 # Reset device
 monitor reset
-
 # Set device ID to LPC1343
 monitor flash device = LPC1343
-
 # Enable flash download
 monitor flash download = 1
-
 # Transfer the firmware to the device
 load "../../firmware.elf"
-
 # Initializing PC and stack pointer
 monitor reg r13 = (0x00000000)
 monitor reg pc = (0x00000004)
@@ -337,12 +341,12 @@ monitor reg pc = (0x00000004)
       </AdditionalRules>
     </Configuration>
     <Configuration Name="Release" CompilerType="gnu gcc" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
-      <Compiler Options="" Required="yes" PreCompiledHeader="">
+      <Compiler Options="" C_Options="" Required="yes" PreCompiledHeader="">
         <IncludePath Value="."/>
       </Compiler>
       <Linker Options="-O2" Required="yes"/>
       <ResourceCompiler Options="" Required="no"/>
-      <General OutputFile="" IntermediateDirectory="./Release" Command="" CommandArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
+      <General OutputFile="" IntermediateDirectory="./Release" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes"/>
       <Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;"/>
       <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="">
         <PostConnectCommands/>
@@ -365,14 +369,5 @@ monitor reg pc = (0x00000004)
         <CustomPreBuild/>
       </AdditionalRules>
     </Configuration>
-    <GlobalSettings>
-      <Compiler Options="">
-        <IncludePath Value="."/>
-      </Compiler>
-      <Linker Options="">
-        <LibraryPath Value="."/>
-      </Linker>
-      <ResourceCompiler Options=""/>
-    </GlobalSettings>
   </Settings>
 </CodeLite_Project>
index 4085d03..36f5af9 100644 (file)
               </file>
             </folder>
             <folder Name="fonts">
-              <file file_name="../../drivers/lcd/tft/fonts/veramono11.c">
+              <file file_name="../../drivers/lcd/tft/fonts/dejavusansmono8.c">
+                <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
                 <configuration Name="THUMB Flash Release" build_exclude_from_build="No"/>
               </file>
-              <file file_name="../../drivers/lcd/tft/fonts/veramonobold11.c">
+              <file file_name="../../drivers/lcd/tft/fonts/dejavusansmonobold8.c">
+                <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
                 <configuration Name="THUMB Flash Release" build_exclude_from_build="No"/>
               </file>
-              <file file_name="../../drivers/lcd/tft/fonts/veramono9.c">
+              <file file_name="../../drivers/lcd/tft/fonts/dejavusanscondensed9.c">
+                <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
                 <configuration Name="THUMB Flash Release" build_exclude_from_build="No"/>
               </file>
-              <file file_name="../../drivers/lcd/tft/fonts/veramonobold9.c">
+              <file file_name="../../drivers/lcd/tft/fonts/dejavusans9.c">
+                <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
+                <configuration Name="THUMB Flash Release" build_exclude_from_build="No"/>
+              </file>
+              <file file_name="../../drivers/lcd/tft/fonts/dejavusansbold9.c">
+                <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
                 <configuration Name="THUMB Flash Release" build_exclude_from_build="No"/>
               </file>
-              <file file_name="../../drivers/lcd/tft/fonts/dejavusansmono8.c"/>
-              <file file_name="../../drivers/lcd/tft/fonts/dejavusansmonobold8.c"/>
-              <file file_name="../../drivers/lcd/tft/fonts/dejavusanscondensed9.c"/>
-              <file file_name="../../drivers/lcd/tft/fonts/dejavusans9.c"/>
-              <file file_name="../../drivers/lcd/tft/fonts/dejavusansbold9.c"/>
+              <file file_name="../../drivers/lcd/tft/fonts/verdana9.c"/>
+              <file file_name="../../drivers/lcd/tft/fonts/verdanabold14.c"/>
+              <file file_name="../../drivers/lcd/tft/fonts/verdana14.c"/>
             </folder>
             <file file_name="../../drivers/lcd/tft/drawing.c">
               <configuration Name="THUMB Flash Debug" build_exclude_from_build="No"/>
   <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" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/;$(ProjectDir)/../../core/freakusb/usb/;$(ProjectDir)/../../core/freakusb/class/CDC/;$(ProjectDir)/../../core/freakusb/hw/lpc1343/"/>
+  <configuration Name="Common" arm_linker_allow_multiple_definition="Yes" c_user_include_directories="$(ProjectDir)/../../;$(ProjectDir)/../../Project/;$(ProjectDir)/../../core/freakusb/usb/;$(ProjectDir)/../../core/freakusb/class/CDC/;$(ProjectDir)/../../core/freakusb/hw/lpc1343/"/>
 </solution>
index e88fa52..da75ee1 100644 (file)
   <BreakpointListItem group="CM Exceptions" type="Exception" state="2" counter="0" expression="UsageFault_Coprocessor" />
   <BreakpointListItem group="CM Exceptions" type="Exception" state="2" counter="0" expression="UsageFault_StateError" />
  </Breakpoints>
+ <ETMWindow>
+  <ETMRegister number="0" value="800" />
+  <ETMRegister number="8" value="6f" />
+  <ETMRegister number="9" value="1000000" />
+ </ETMWindow>
  <ExecutionCountWindow/>
  <Memory1>
   <MemoryWindow autoEvaluate="0" addressText="&amp;header" numColumns="8" sizeText="sizeof(header)" dataSize="1" radix="16" addressSpace="" />
  </TraceWindow>
  <Watch1>
   <Watches active="1" update="Each Second" >
-   <Watchpoint linenumber="66" radix="10" name="msTicks" expression="msTicks" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/systick/systick.c" />
-   <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
-   <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
    <Watchpoint linenumber="155" radix="16" name="Tick" expression="Tick" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
+   <Watchpoint linenumber="155" radix="-1" name="xTickCount" expression="xTickCount" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/freertos/tasks.c" />
+   <Watchpoint linenumber="138" radix="16" name="timer32_0_counter" expression="timer32_0_counter" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/timer32/timer32.c" />
+   <Watchpoint linenumber="66" radix="10" name="msTicks" expression="msTicks" filename="c:/documents and settings/kevin/my documents/my dropbox/microbuilder/code/lpc1343/lpc1343_codebase/core/systick/systick.c" />
   </Watches>
  </Watch1>
  <Watch2>
@@ -63,8 +68,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\main.c" y="18" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="0" />
-  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" y="50" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\projectconfig.h" left="0" selected="0" name="unnamed" top="21" />
+  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="72" debugPath="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" y="18" path="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\main.c" left="0" selected="1" name="unnamed" top="0" />
  </Files>
- <ARMCrossStudioWindow activeProject="LPC1343_CodeBase" autoConnectTarget="Segger J-Link" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dropbox\microBuilder\Code\LPC1343\LPC1343_CodeBase_GIT\project\commands\drawing" 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\lcd\tft\fonts" fileDialogDefaultFilter="" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Release" />
 </session>
index 4c674f2..10080fc 100644 (file)
@@ -102,24 +102,39 @@ void cpuPllSetup (cpuMultiplier_t multiplier)
   // Set clock speed
   switch (multiplier)
   {
+    // Fclkout = M * Fclkin = FCCO / (2 * P)
+    // FCCO should be in the range of 156-320MHz 
+    // (see Table 58 of the LPC1343 usermanual for examples)
     case CPU_MULTIPLIER_2:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_2 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 24.0MHz
+      // FCCO = 2 * 4 * 24 = 192MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_2 | SCB_PLLCTRL_PSEL_4);
       break;
     case CPU_MULTIPLIER_3:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_3 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 36.0MHz
+      // FCCO = 2 * 4 * 36 = 288MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_3 | SCB_PLLCTRL_PSEL_4);
       break;
     case CPU_MULTIPLIER_4:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_4 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 48.0MHz
+      // FCCO = 2 * 2 * 48 = 192MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_4 | SCB_PLLCTRL_PSEL_2);
       break;
     case CPU_MULTIPLIER_5:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_5 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 60.0MHz
+      // FCCO = 2 * 2 * 60 = 240MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_5 | SCB_PLLCTRL_PSEL_2);
       break;
     case CPU_MULTIPLIER_6:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_6 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 72.0MHz
+      // FCCO = 2 * 2 * 72 = 288MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_6 | SCB_PLLCTRL_PSEL_2);
       break;
     case CPU_MULTIPLIER_1:
     default:
-      SCB_PLLCTRL = (SCB_PLLCTRL_MULT_1 | (1 << SCB_PLLCTRL_DIV_BIT));
+      // Fclkout = 12.0MHz
+      // FCCO = 2 * 8 * 12 = 192MHz
+      SCB_PLLCTRL = (SCB_PLLCTRL_MSEL_1 | SCB_PLLCTRL_PSEL_8);
       break;
   }
 
index fe33aba..0544f6d 100644 (file)
@@ -169,6 +169,7 @@ void USB_StatusOutStage (void) {
 
 static inline uint32_t USB_ReqGetStatus (void) {
   uint32_t n, m;
+  uint16_t* ep0 = (uint16_t __attribute__((packed)) *)EP0Buf;
 
   switch (SetupPacket.bmRequestType.BM.Recipient) {
     case REQUEST_TO_DEVICE:
@@ -176,7 +177,8 @@ static inline uint32_t USB_ReqGetStatus (void) {
       break;
     case REQUEST_TO_INTERFACE:
       if ((USB_Configuration != 0) && (SetupPacket.wIndex.WB.L < USB_NumInterfaces)) {
-        *((uint16_t __attribute__((packed)) *)EP0Buf) = 0;
+        //*((uint16_t __attribute__((packed)) *)EP0Buf) = 0;
+        *ep0 = 0;
         EP0Data.pData = EP0Buf;
       } else {
         return (FALSE);
@@ -186,7 +188,8 @@ static inline uint32_t USB_ReqGetStatus (void) {
       n = SetupPacket.wIndex.WB.L & 0x8F;
       m = (n & 0x80) ? ((1 << 16) << (n & 0x0F)) : (1 << n);
       if (((USB_Configuration != 0) || ((n & 0x0F) == 0)) && (USB_EndPointMask & m)) {
-        *((uint16_t __attribute__((packed)) *)EP0Buf) = (USB_EndPointHalt & m) ? 1 : 0;
+        // *((uint16_t __attribute__((packed)) *)EP0Buf) = (USB_EndPointHalt & m) ? 1 : 0;
+        *ep0 = (USB_EndPointHalt & m) ? 1 : 0;
         EP0Data.pData = EP0Buf;
       } else {
         return (FALSE);
index f7b2ab5..fe8956a 100644 (file)
@@ -73,9 +73,7 @@ void drawSwap(uint32_t a, uint32_t b)
 /**************************************************************************/
 void drawCharBitmap(const uint16_t xPixel, const uint16_t yPixel, uint16_t color, const uint8_t *glyph, uint8_t cols, uint8_t rows)
 {
-  uint16_t verticalPage, horizBit, currentY, currentX;
-  uint16_t indexIntoGlyph;
-
+  uint16_t currentY, currentX, indexIntoGlyph;
   uint16_t _row, _col, _colPages;
 
   // set initial current y
index 8b0e64a..1e75eca 100644 (file)
@@ -50,6 +50,9 @@
 #include "core/systick/systick.h"
 #include "drivers/lcd/tft/touchscreen.h"
 
+// Uncomment this to use faster inline methods, but requires more flash
+// #define ILI9235_USE_INLINE_METHODS (1)
+
 static lcdOrientation_t lcdOrientation = LCD_ORIENTATION_PORTRAIT;
 static lcdProperties_t ili9325Properties = { 240, 320, TRUE, TRUE, TRUE };
 
@@ -62,6 +65,7 @@ static lcdProperties_t ili9325Properties = { 240, 320, TRUE, TRUE, TRUE };
     @brief  Causes a brief delay (10 ticks per unit)
 */
 /**************************************************************************/
+#if !defined ILI9235_USE_INLINE_METHODS
 void ili9325Delay(unsigned int t)
 {
   unsigned char t1;
@@ -71,12 +75,16 @@ void ili9325Delay(unsigned int t)
     __asm("nop");
   }
 }
+#else
+static inline uint32_t ili9325Delay(unsigned int t)     { unsigned char t1; while(t--) for ( t1=10; t1 > 0; t1-- ) { __asm("nop"); } }
+#endif
 
 /**************************************************************************/
 /*! 
     @brief  Writes the supplied 16-bit command using an 8-bit interface
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9325WriteCmd(uint16_t command) 
 {
   // Compiled with -Os on GCC 4.4 this works out to 25 cycles
@@ -94,12 +102,16 @@ void ili9325WriteCmd(uint16_t command)
   CLR_WR;
   SET_WR_CS;            // Saves 7 commands compared to "SET_WR; SET_CS;"
 }
+#else
+static inline void ili9325WriteCmd(uint16_t command) { CLR_CS_CD_SET_RD_WR; ILI9325_GPIO2DATA_DATA = (command >> (8 - ILI9325_DATA_OFFSET)); CLR_WR; SET_WR; ILI9325_GPIO2DATA_DATA = command << ILI9325_DATA_OFFSET; CLR_WR; SET_WR_CS; }
+#endif
 
 /**************************************************************************/
 /*! 
     @brief  Writes the supplied 16-bit data using an 8-bit interface
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9325WriteData(uint16_t data)
 {
   CLR_CS_SET_CD_RD_WR;  // Saves 18 commands compared to SET_CD; SET_RD; SET_WR; CLR_CS"
@@ -110,6 +122,9 @@ void ili9325WriteData(uint16_t data)
   CLR_WR;
   SET_WR_CS;            // Saves 7 commands compared to "SET_WR, SET_CS;"
 }
+#else
+static inline void ili9325WriteData(uint16_t data) {   CLR_CS_SET_CD_RD_WR; ILI9325_GPIO2DATA_DATA = (data >> (8 - ILI9325_DATA_OFFSET)); CLR_WR; SET_WR; ILI9325_GPIO2DATA_DATA = data << ILI9325_DATA_OFFSET; CLR_WR; SET_WR_CS; }
+#endif
 
 /**************************************************************************/
 /*! 
@@ -191,6 +206,7 @@ uint16_t ili9325Type(void)
     @brief  Sets the cursor to the specified X/Y position
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9325SetCursor(uint16_t x, uint16_t y)
 {
   uint16_t al, ah;
@@ -209,6 +225,9 @@ void ili9325SetCursor(uint16_t x, uint16_t y)
   ili9325Command(ILI9325_COMMANDS_HORIZONTALGRAMADDRESSSET, al);
   ili9325Command(ILI9325_COMMANDS_VERTICALGRAMADDRESSSET, ah);
 }
+#else
+static inline void ili9325SetCursor(uint16_t x, uint16_t y) { uint16_t al, ah; if (lcdOrientation == LCD_ORIENTATION_LANDSCAPE) { al = y; ah = x; } else { al = x; ah = y; }; ili9325WriteCmd(ILI9325_COMMANDS_HORIZONTALGRAMADDRESSSET); ili9325WriteData(al); ili9325WriteCmd(ILI9325_COMMANDS_VERTICALGRAMADDRESSSET); ili9325WriteData(ah); }
+#endif
 
 /**************************************************************************/
 /*! 
index 347d410..aba75c2 100644 (file)
@@ -43,6 +43,9 @@
 #include "core/systick/systick.h"
 #include "drivers/lcd/tft/touchscreen.h"
 
+// Uncomment this to use faster inline methods, but requires more flash
+#define ILI9238_USE_INLINE_METHODS (1)
+
 static volatile lcdOrientation_t lcdOrientation = LCD_ORIENTATION_PORTRAIT;
 static lcdProperties_t ili9328Properties = { 240, 320, TRUE, TRUE, TRUE };
 
@@ -55,6 +58,7 @@ static lcdProperties_t ili9328Properties = { 240, 320, TRUE, TRUE, TRUE };
     @brief  Causes a brief delay (10 ticks per unit)
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9328Delay(unsigned int t)
 {
   unsigned char t1;
@@ -64,12 +68,16 @@ void ili9328Delay(unsigned int t)
     __asm("nop");
   }
 }
+#else
+static inline void ili9328Delay(unsigned int t)     { unsigned char t1; while(t--) for ( t1=10; t1 > 0; t1-- ) { __asm("nop"); } }
+#endif
 
 /**************************************************************************/
 /*! 
     @brief  Writes the supplied 16-bit command using an 8-bit interface
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9328WriteCmd(uint16_t command) 
 {
   // Compiled with -Os on GCC 4.4 this works out to 25 cycles
@@ -87,12 +95,16 @@ void ili9328WriteCmd(uint16_t command)
   CLR_WR;
   SET_WR_CS;            // Saves 7 commands compared to "SET_WR; SET_CS;"
 }
+#else
+static inline void ili9328WriteCmd(uint16_t command) { CLR_CS_CD_SET_RD_WR; ILI9328_GPIO2DATA_DATA = (command >> (8 - ILI9328_DATA_OFFSET)); CLR_WR; SET_WR; ILI9328_GPIO2DATA_DATA = command << ILI9328_DATA_OFFSET; CLR_WR; SET_WR_CS; }
+#endif
 
 /**************************************************************************/
 /*! 
     @brief  Writes the supplied 16-bit data using an 8-bit interface
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9328WriteData(uint16_t data)
 {
   CLR_CS_SET_CD_RD_WR;  // Saves 18 commands compared to SET_CD; SET_RD; SET_WR; CLR_CS"
@@ -103,6 +115,9 @@ void ili9328WriteData(uint16_t data)
   CLR_WR;
   SET_WR_CS;            // Saves 7 commands compared to "SET_WR, SET_CS;"
 }
+#else
+static inline void ili9328WriteData(uint16_t data) {   CLR_CS_SET_CD_RD_WR; ILI9328_GPIO2DATA_DATA = (data >> (8 - ILI9328_DATA_OFFSET)); CLR_WR; SET_WR; ILI9328_GPIO2DATA_DATA = data << ILI9328_DATA_OFFSET; CLR_WR; SET_WR_CS; }
+#endif
 
 /**************************************************************************/
 /*! 
@@ -184,6 +199,7 @@ uint16_t ili9328Type(void)
     @brief  Sets the cursor to the specified X/Y position
 */
 /**************************************************************************/
+#if !defined ILI9238_USE_INLINE_METHODS
 void ili9328SetCursor(uint16_t x, uint16_t y)
 {
   uint16_t al, ah;
@@ -202,6 +218,9 @@ void ili9328SetCursor(uint16_t x, uint16_t y)
   ili9328Command(ILI9328_COMMANDS_HORIZONTALGRAMADDRESSSET, al);
   ili9328Command(ILI9328_COMMANDS_VERTICALGRAMADDRESSSET, ah);
 }
+#else
+static inline void ili9328SetCursor(uint16_t x, uint16_t y) { uint16_t al, ah; if (lcdOrientation == LCD_ORIENTATION_LANDSCAPE) { al = y; ah = x; } else { al = x; ah = y; }; ili9328WriteCmd(ILI9328_COMMANDS_HORIZONTALGRAMADDRESSSET); ili9328WriteData(al); ili9328WriteCmd(ILI9328_COMMANDS_VERTICALGRAMADDRESSSET); ili9328WriteData(ah); }
+#endif
 
 /**************************************************************************/
 /*! 
index 20e9a19..4d4a2cd 100644 (file)
@@ -213,7 +213,7 @@ tsTouchData_t tsRenderCalibrationScreen(uint16_t x, uint16_t y, uint16_t radius)
     @note  This is based on the public domain touch screen calibration code
            written by Carlos E. Vidales (copyright (c) 2001).
 
-           For more inforormation, see the following app notes:
+           For more information, see the following app notes:
 
            - AN2173 - Touch Screen Control and Calibration
              Svyatoslav Paliy, Cypress Microsystems
@@ -262,7 +262,6 @@ int setCalibrationMatrix( tsPoint_t * displayPtr, tsPoint_t * screenPtr, tsMatri
     eepromWriteS32(CFG_EEPROM_TOUCHSCREEN_CAL_DN, matrixPtr->Dn);
     eepromWriteS32(CFG_EEPROM_TOUCHSCREEN_CAL_EN, matrixPtr->En);
     eepromWriteS32(CFG_EEPROM_TOUCHSCREEN_CAL_FN, matrixPtr->Fn);
-    eepromWriteS32(CFG_EEPROM_TOUCHSCREEN_CAL_FN, matrixPtr->Fn);
     eepromWriteS32(CFG_EEPROM_TOUCHSCREEN_CAL_DIVIDER, matrixPtr->Divider);
     eepromWriteU8(CFG_EEPROM_TOUCHSCREEN_CALIBRATED, 1);
   }
index ed2d0f8..fbb2275 100644 (file)
@@ -46,8 +46,6 @@ extern volatile uint8_t   I2CMasterBuffer[I2C_BUFSIZE];
 extern volatile uint8_t   I2CSlaveBuffer[I2C_BUFSIZE];
 extern volatile uint32_t  I2CReadLength, I2CWriteLength;
 
-uint8_t monthday[12]={31,28,31,30,31,30,31,31,30,31,30,31};
-
 static bool _isl12022mInitialised = false;
 
 /**************************************************************************/
index 9da8fcb..cb41088 100644 (file)
--- a/lpc134x.h
+++ b/lpc134x.h
     subsystem. Note that the USB subsystem has its own dedicated PLL. The PLL can
     produce a clock up to the maximum allowed for the CPU, which is 72 MHz. */
 
-#define SCB_PLLCTRL_MULT_1                        ((unsigned int) 0x00000000)
-#define SCB_PLLCTRL_MULT_2                        ((unsigned int) 0x00000001)
-#define SCB_PLLCTRL_MULT_3                        ((unsigned int) 0x00000002)
-#define SCB_PLLCTRL_MULT_4                        ((unsigned int) 0x00000003)
-#define SCB_PLLCTRL_MULT_5                        ((unsigned int) 0x00000004)
-#define SCB_PLLCTRL_MULT_6                        ((unsigned int) 0x00000005)
-#define SCB_PLLCTRL_MULT_7                        ((unsigned int) 0x00000006)
-#define SCB_PLLCTRL_MULT_8                        ((unsigned int) 0x00000007)
-#define SCB_PLLCTRL_MULT_9                        ((unsigned int) 0x00000008)
-#define SCB_PLLCTRL_MULT_10                       ((unsigned int) 0x00000009)
-#define SCB_PLLCTRL_MULT_11                       ((unsigned int) 0x0000000A)
-#define SCB_PLLCTRL_MULT_12                       ((unsigned int) 0x0000000B)
-#define SCB_PLLCTRL_MULT_13                       ((unsigned int) 0x0000000C)
-#define SCB_PLLCTRL_MULT_14                       ((unsigned int) 0x0000000D)
-#define SCB_PLLCTRL_MULT_15                       ((unsigned int) 0x0000000E)
-#define SCB_PLLCTRL_MULT_16                       ((unsigned int) 0x0000000F)
-#define SCB_PLLCTRL_MULT_17                       ((unsigned int) 0x00000010)
-#define SCB_PLLCTRL_MULT_18                       ((unsigned int) 0x00000011)
-#define SCB_PLLCTRL_MULT_19                       ((unsigned int) 0x00000012)
-#define SCB_PLLCTRL_MULT_20                       ((unsigned int) 0x00000013)
-#define SCB_PLLCTRL_MULT_21                       ((unsigned int) 0x00000014)
-#define SCB_PLLCTRL_MULT_22                       ((unsigned int) 0x00000015)
-#define SCB_PLLCTRL_MULT_23                       ((unsigned int) 0x00000016)
-#define SCB_PLLCTRL_MULT_24                       ((unsigned int) 0x00000017)
-#define SCB_PLLCTRL_MULT_25                       ((unsigned int) 0x00000018)
-#define SCB_PLLCTRL_MULT_26                       ((unsigned int) 0x00000019)
-#define SCB_PLLCTRL_MULT_27                       ((unsigned int) 0x0000001A)
-#define SCB_PLLCTRL_MULT_28                       ((unsigned int) 0x0000001B)
-#define SCB_PLLCTRL_MULT_29                       ((unsigned int) 0x0000001C)
-#define SCB_PLLCTRL_MULT_30                       ((unsigned int) 0x0000001D)
-#define SCB_PLLCTRL_MULT_31                       ((unsigned int) 0x0000001E)
-#define SCB_PLLCTRL_MULT_32                       ((unsigned int) 0x0000001F)
-#define SCB_PLLCTRL_MULT_MASK                     ((unsigned int) 0x0000001F)    
-#define SCB_PLLCTRL_DIV_2                         ((unsigned int) 0x00000000)       
-#define SCB_PLLCTRL_DIV_4                         ((unsigned int) 0x00000020)       
-#define SCB_PLLCTRL_DIV_8                         ((unsigned int) 0x00000040)       
-#define SCB_PLLCTRL_DIV_16                        ((unsigned int) 0x00000060)
-#define SCB_PLLCTRL_DIV_BIT                       (5)
-#define SCB_PLLCTRL_DIV_MASK                      ((unsigned int) 0x00000060)    
+#define SCB_PLLCTRL_MSEL_1                        ((unsigned int) 0x00000000)
+#define SCB_PLLCTRL_MSEL_2                        ((unsigned int) 0x00000001)
+#define SCB_PLLCTRL_MSEL_3                        ((unsigned int) 0x00000002)
+#define SCB_PLLCTRL_MSEL_4                        ((unsigned int) 0x00000003)
+#define SCB_PLLCTRL_MSEL_5                        ((unsigned int) 0x00000004)
+#define SCB_PLLCTRL_MSEL_6                        ((unsigned int) 0x00000005)
+#define SCB_PLLCTRL_MSEL_7                        ((unsigned int) 0x00000006)
+#define SCB_PLLCTRL_MSEL_8                        ((unsigned int) 0x00000007)
+#define SCB_PLLCTRL_MSEL_9                        ((unsigned int) 0x00000008)
+#define SCB_PLLCTRL_MSEL_10                       ((unsigned int) 0x00000009)
+#define SCB_PLLCTRL_MSEL_11                       ((unsigned int) 0x0000000A)
+#define SCB_PLLCTRL_MSEL_12                       ((unsigned int) 0x0000000B)
+#define SCB_PLLCTRL_MSEL_13                       ((unsigned int) 0x0000000C)
+#define SCB_PLLCTRL_MSEL_14                       ((unsigned int) 0x0000000D)
+#define SCB_PLLCTRL_MSEL_15                       ((unsigned int) 0x0000000E)
+#define SCB_PLLCTRL_MSEL_16                       ((unsigned int) 0x0000000F)
+#define SCB_PLLCTRL_MSEL_17                       ((unsigned int) 0x00000010)
+#define SCB_PLLCTRL_MSEL_18                       ((unsigned int) 0x00000011)
+#define SCB_PLLCTRL_MSEL_19                       ((unsigned int) 0x00000012)
+#define SCB_PLLCTRL_MSEL_20                       ((unsigned int) 0x00000013)
+#define SCB_PLLCTRL_MSEL_21                       ((unsigned int) 0x00000014)
+#define SCB_PLLCTRL_MSEL_22                       ((unsigned int) 0x00000015)
+#define SCB_PLLCTRL_MSEL_23                       ((unsigned int) 0x00000016)
+#define SCB_PLLCTRL_MSEL_24                       ((unsigned int) 0x00000017)
+#define SCB_PLLCTRL_MSEL_25                       ((unsigned int) 0x00000018)
+#define SCB_PLLCTRL_MSEL_26                       ((unsigned int) 0x00000019)
+#define SCB_PLLCTRL_MSEL_27                       ((unsigned int) 0x0000001A)
+#define SCB_PLLCTRL_MSEL_28                       ((unsigned int) 0x0000001B)
+#define SCB_PLLCTRL_MSEL_29                       ((unsigned int) 0x0000001C)
+#define SCB_PLLCTRL_MSEL_30                       ((unsigned int) 0x0000001D)
+#define SCB_PLLCTRL_MSEL_31                       ((unsigned int) 0x0000001E)
+#define SCB_PLLCTRL_MSEL_32                       ((unsigned int) 0x0000001F)
+#define SCB_PLLCTRL_MSEL_MASK                     ((unsigned int) 0x0000001F)    
+#define SCB_PLLCTRL_PSEL_2                        ((unsigned int) 0x00000000)       
+#define SCB_PLLCTRL_PSEL_4                        ((unsigned int) 0x00000020)       
+#define SCB_PLLCTRL_PSEL_8                        ((unsigned int) 0x00000040)       
+#define SCB_PLLCTRL_PSEL_16                       ((unsigned int) 0x00000060)
+#define SCB_PLLCTRL_PSEL_BIT                      (5)
+#define SCB_PLLCTRL_PSEL_MASK                     ((unsigned int) 0x00000060)    
 #define SCB_PLLCTRL_DIRECT_MASK                   ((unsigned int) 0x00000080) // Direct CCO clock output control
 #define SCB_PLLCTRL_BYPASS_MASK                   ((unsigned int) 0x00000100) // Input clock bypass control
 #define SCB_PLLCTRL_MASK                          ((unsigned int) 0x000001FF)    
 #define IOCON_SWDIO_PIO1_3_FUNC_SWDIO             ((unsigned int) 0x00000000)
 #define IOCON_SWDIO_PIO1_3_FUNC_GPIO              ((unsigned int) 0x00000001)
 #define IOCON_SWDIO_PIO1_3_FUNC_AD4               ((unsigned int) 0x00000002)
-#define IOCON_SWDIO_PIO1_3_FUNC_CT32B1_MAT2       ((unsigned int) 0x00000004)
+#define IOCON_SWDIO_PIO1_3_FUNC_CT32B1_MAT2       ((unsigned int) 0x00000003)
 #define IOCON_SWDIO_PIO1_3_HYS_MASK               ((unsigned int) 0x00000020)
 #define IOCON_SWDIO_PIO1_3_HYS_DISABLE            ((unsigned int) 0x00000000)
 #define IOCON_SWDIO_PIO1_3_HYS_ENABLE             ((unsigned int) 0x00000020)
index 1252ef0..edee264 100644 (file)
     -----------------------------------------------------------------------*/
     #define CFG_FIRMWARE_VERSION_MAJOR            (0)
     #define CFG_FIRMWARE_VERSION_MINOR            (9)
-    #define CFG_FIRMWARE_VERSION_REVISION         (3)
+    #define CFG_FIRMWARE_VERSION_REVISION         (5)
 /*=========================================================================*/
 
 
index a8160a8..727deee 100644 (file)
@@ -24,7 +24,7 @@
     <descImgWidth>DisplayInBytes</descImgWidth>
     <descImgHeight>DisplayInBits</descImgHeight>
     <generateSpaceCharacterBitmap>true</generateSpaceCharacterBitmap>
-    <spaceGenerationPixels>8</spaceGenerationPixels>
+    <spaceGenerationPixels>5</spaceGenerationPixels>
     <varNfBitmaps>const uint8_t {0}Bitmaps</varNfBitmaps>
     <varNfCharInfo>const FONT_CHAR_INFO {0}Descriptors</varNfCharInfo>
     <varNfFontInfo>const FONT_INFO {0}FontInfo</varNfFontInfo>
This page took 0.064447 seconds and 4 git commands to generate.