]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Completing CMake variable generation for USB parameters (AVR Support)
authorJacob Alexander <triplehaata@gmail.com>
Sat, 2 Feb 2013 01:30:14 +0000 (20:30 -0500)
committerJacob Alexander <triplehaata@gmail.com>
Sat, 2 Feb 2013 01:30:14 +0000 (20:30 -0500)
- Had to add the iSerialNumber parameter to the AVR USB descriptor
- Removed a faulty pack command for avr-gcc that is not required

CMakeLists.txt
Lib/_buildvars.h [new file with mode: 0644]
USB/pjrc/arm/usb_desc.h
USB/pjrc/avr/usb_keyboard_debug.c
USB/pjrc/avr/usb_keyboard_debug.h
avr.cmake
setup.cmake

index c361cd0d12d021668b0ed759ecadf449cde01a01..d52b39e86c8589ce63a59c1ca454f05ea858e26a 100644 (file)
@@ -27,8 +27,8 @@ include( AddFileDependencies )
 #| "avr"       # Teensy++ 1.0
 #| "avr"       # Teensy++ 2.0
 #| "arm"       # Teensy   3.0
-set( COMPILER_FAMILY "arm" )
-#set( COMPILER_FAMILY "avr" )
+#set( COMPILER_FAMILY "arm" )
+set( COMPILER_FAMILY "avr" )
 
 message( STATUS "Compiler Family:" )
 message( "${COMPILER_FAMILY}" )
diff --git a/Lib/_buildvars.h b/Lib/_buildvars.h
new file mode 100644 (file)
index 0000000..7a8c864
--- /dev/null
@@ -0,0 +1,45 @@
+/* Copyright (C) 2013 by Jacob Alexander
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ * 
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef __buildvars_h
+#define __buildvars_h
+
+// ----- Includes -----
+
+
+
+// ----- Defines -----
+
+// You can change these to give your code its own name.
+#define STR_MANUFACTURER       L"@MANUFACTURER@"
+#define STR_PRODUCT            L"Keyboard - @ScanModule@ @MacroModule@ @USBModule@ @DebugModule@"
+#define STR_SERIAL              L"@GitLastCommitDate@"
+
+
+// Mac OS-X and Linux automatically load the correct drivers.  On
+// Windows, even though the driver is supplied by Microsoft, an
+// INF file is needed to load the driver.  These numbers need to
+// match the INF file.
+#define VENDOR_ID              @VENDOR_ID@
+#define PRODUCT_ID             @PRODUCT_ID@
+
+#endif
+
index a45ea76bb28211e139e4a79f2cd4d3cb41b5707d..dcd85cc3018fcf44519f9d02ebafeef3a637f7fb 100644 (file)
 #define DEVICE_CLASS           0xEF
 #define DEVICE_SUBCLASS        0x02
 #define DEVICE_PROTOCOL        0x01
-#define MANUFACTURER_NAME      {'T','e','e','n','s','y','d','u','i','n','o'}
-#define MANUFACTURER_NAME_LEN  11
-#define PRODUCT_NAME           {'S','e','r','i','a','l','/','K','e','y','b','o','a','r','d','/','M','o','u','s','e','/','J','o','y','s','t','i','c','k'}
-#define PRODUCT_NAME_LEN       30
 #define EP0_SIZE               64
 #define NUM_ENDPOINTS          15
 #define NUM_INTERFACE          5
index 5e283abdc2099c918a8ed4ec3d7d039a53fdcf4e..3a792cf77836f458ab9cdbf6ddf6a3fef9a25df9 100644 (file)
@@ -94,7 +94,7 @@ static const uint8_t PROGMEM device_descriptor[] = {
        0x00, 0x01,                             // bcdDevice
        1,                                      // iManufacturer
        2,                                      // iProduct
-       0,                                      // iSerialNumber
+       3,                                      // iSerialNumber
        1                                       // bNumConfigurations
 };
 
@@ -239,6 +239,11 @@ static const struct usb_string_descriptor_struct PROGMEM string2 = {
        3,
        STR_PRODUCT
 };
+static const struct usb_string_descriptor_struct PROGMEM string3 = {
+       sizeof(STR_SERIAL),
+       3,
+       STR_SERIAL
+};
 
 // This table defines which descriptor data is sent for each specific
 // request from the host (in wValue and wIndex).
@@ -256,7 +261,8 @@ static const struct descriptor_list_struct {
        {0x2100, DEBUG_INTERFACE, config1_descriptor+DEBUG_HID_DESC_OFFSET, 9},
        {0x0300, 0x0000, (const uint8_t *)&string0, 4},
        {0x0301, 0x0409, (const uint8_t *)&string1, sizeof(STR_MANUFACTURER)},
-       {0x0302, 0x0409, (const uint8_t *)&string2, sizeof(STR_PRODUCT)}
+       {0x0302, 0x0409, (const uint8_t *)&string2, sizeof(STR_PRODUCT)},
+       {0x0303, 0x0409, (const uint8_t *)&string3, sizeof(STR_SERIAL)}
 };
 #define NUM_DESC_LIST (sizeof(descriptor_list)/sizeof(struct descriptor_list_struct))
 
@@ -697,4 +703,3 @@ ISR(USB_COM_vect)
        UECONX = (1<<STALLRQ) | (1<<EPEN);      // stall
 }
 
-
index f592bc102d1d67586121a74c1f1bbb3882073643..987e4fd9d7b91a4dfd455455e6825fc8aa71773b 100644 (file)
@@ -87,3 +87,4 @@ void usb_debug_flush_output(void);    // immediately transmit any buffered output
 #define CDC_SET_CONTROL_LINE_STATE     0x22
 #endif
 #endif
+
index 7bed316539c65ae266a7850d3482a29657beed03..c39ed0daa6eb43b11827700eeacca9f9061a0e4f 100644 (file)
--- a/avr.cmake
+++ b/avr.cmake
@@ -72,7 +72,7 @@ set( WARN "-Wall -Wstrict-prototypes" )
 #| Tuning Options
 #|  -f...:        tuning, see GCC manual and avr-libc documentation
 #| NOTE: -fshort-wchar is specified to allow USB strings be passed conveniently
-set( TUNING "-funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums -fshort-wchar" )
+set( TUNING "-funsigned-char -funsigned-bitfields -ffunction-sections -fpack-struct -fshort-enums" )
 
 
 #| Optimization level, can be [0, 1, 2, 3, s]. 
index 4971e5ed17f32c0d54616ab7a853ed6afa947e7e..6e2dae557855ab933eee52b68fc10ab445688d03 100644 (file)
@@ -20,7 +20,7 @@
 #| Please the {Scan,Macro,USB,Debug}/module.txt for information on the modules and how to create new ones
 
 ##| Deals with acquiring the keypress information and turning it into a key index
-set(  ScanModule  "MBC-55X" )
+set(  ScanModule  "FACOM6684" )
 
 ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code
 set( MacroModule  "buffer"  )