# HG changeset patch # User Jacob Alexander # Date 1359779712 18000 # Node ID 3d4cf158742e989e3905601837079cd8b5f13ba3 # Parent ef802d78674876e3d3361d78d4384993346fafec Removed Joystick endpoint from ARM usb module - Also a bit of general house-keeping diff -r ef802d786748 -r 3d4cf158742e CMakeLists.txt --- a/CMakeLists.txt Fri Feb 01 21:19:31 2013 -0500 +++ b/CMakeLists.txt Fri Feb 01 23:35:12 2013 -0500 @@ -27,8 +27,8 @@ #| "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 -r ef802d786748 -r 3d4cf158742e USB/pjrc/arm/usb_desc.c --- a/USB/pjrc/arm/usb_desc.c Fri Feb 01 21:19:31 2013 -0500 +++ b/USB/pjrc/arm/usb_desc.c Fri Feb 01 23:35:12 2013 -0500 @@ -152,53 +152,6 @@ }; #endif -#ifdef JOYSTICK_INTERFACE -static uint8_t joystick_report_desc[] = { - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x04, // Usage (Joystick) - 0xA1, 0x01, // Collection (Application) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x75, 0x01, // Report Size (1) - 0x95, 0x20, // Report Count (32) - 0x05, 0x09, // Usage Page (Button) - 0x19, 0x01, // Usage Minimum (Button #1) - 0x29, 0x20, // Usage Maximum (Button #32) - 0x81, 0x02, // Input (variable,absolute) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x07, // Logical Maximum (7) - 0x35, 0x00, // Physical Minimum (0) - 0x46, 0x3B, 0x01, // Physical Maximum (315) - 0x75, 0x04, // Report Size (4) - 0x95, 0x01, // Report Count (1) - 0x65, 0x14, // Unit (20) - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x39, // Usage (Hat switch) - 0x81, 0x42, // Input (variable,absolute,null_state) - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x01, // Usage (Pointer) - 0xA1, 0x00, // Collection () - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x03, // Logical Maximum (1023) - 0x75, 0x0A, // Report Size (10) - 0x95, 0x04, // Report Count (4) - 0x09, 0x30, // Usage (X) - 0x09, 0x31, // Usage (Y) - 0x09, 0x32, // Usage (Z) - 0x09, 0x35, // Usage (Rz) - 0x81, 0x02, // Input (variable,absolute) - 0xC0, // End Collection - 0x15, 0x00, // Logical Minimum (0) - 0x26, 0xFF, 0x03, // Logical Maximum (1023) - 0x75, 0x0A, // Report Size (10) - 0x95, 0x02, // Report Count (2) - 0x09, 0x36, // Usage (Slider) - 0x09, 0x36, // Usage (Slider) - 0x81, 0x02, // Input (variable,absolute) - 0xC0 // End Collection -}; -#endif - // ************************************************************** @@ -354,35 +307,6 @@ MOUSE_SIZE, 0, // wMaxPacketSize MOUSE_INTERVAL, // bInterval #endif // MOUSE_INTERFACE - -#ifdef JOYSTICK_INTERFACE - // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12 - 9, // bLength - 4, // bDescriptorType - JOYSTICK_INTERFACE, // bInterfaceNumber - 0, // bAlternateSetting - 1, // bNumEndpoints - 0x03, // bInterfaceClass (0x03 = HID) - 0x00, // bInterfaceSubClass - 0x00, // bInterfaceProtocol - 0, // iInterface - // HID interface descriptor, HID 1.11 spec, section 6.2.1 - 9, // bLength - 0x21, // bDescriptorType - 0x11, 0x01, // bcdHID - 0, // bCountryCode - 1, // bNumDescriptors - 0x22, // bDescriptorType - LSB(sizeof(joystick_report_desc)), // wDescriptorLength - MSB(sizeof(joystick_report_desc)), - // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13 - 7, // bLength - 5, // bDescriptorType - JOYSTICK_ENDPOINT | 0x80, // bEndpointAddress - 0x03, // bmAttributes (0x03=intr) - JOYSTICK_SIZE, 0, // wMaxPacketSize - JOYSTICK_INTERVAL, // bInterval -#endif }; @@ -442,10 +366,6 @@ {0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)}, {0x2100, MOUSE_INTERFACE, config_descriptor+MOUSE_DESC_OFFSET, 9}, #endif -#ifdef JOYSTICK_INTERFACE - {0x2200, JOYSTICK_INTERFACE, joystick_report_desc, sizeof(joystick_report_desc)}, - {0x2100, JOYSTICK_INTERFACE, config_descriptor+JOYSTICK_DESC_OFFSET, 9}, -#endif {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)}, @@ -551,6 +471,3 @@ #endif }; - - - diff -r ef802d786748 -r 3d4cf158742e USB/pjrc/arm/usb_desc.h --- a/USB/pjrc/arm/usb_desc.h Fri Feb 01 21:19:31 2013 -0500 +++ b/USB/pjrc/arm/usb_desc.h Fri Feb 01 23:35:12 2013 -0500 @@ -25,7 +25,7 @@ #define DEVICE_PROTOCOL 0x01 #define EP0_SIZE 64 #define NUM_ENDPOINTS 15 -#define NUM_INTERFACE 5 +#define NUM_INTERFACE 4 #define CDC_IAD_DESCRIPTOR 1 #define CDC_STATUS_INTERFACE 0 #define CDC_DATA_INTERFACE 1 // Serial @@ -43,20 +43,14 @@ #define MOUSE_ENDPOINT 5 #define MOUSE_SIZE 8 #define MOUSE_INTERVAL 2 -#define JOYSTICK_INTERFACE 4 // Joystick -#define JOYSTICK_ENDPOINT 6 -#define JOYSTICK_SIZE 16 -#define JOYSTICK_INTERVAL 1 #define KEYBOARD_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9) #define MOUSE_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9) -#define JOYSTICK_DESC_OFFSET (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7 + 9) -#define CONFIG_DESC_SIZE (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7 + 9+9+7) +#define CONFIG_DESC_SIZE (9+8 + 9+5+5+4+5+7+9+7+7 + 9+9+7 + 9+9+7) #define ENDPOINT1_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT2_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY #define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY #define ENDPOINT5_CONFIG ENDPOINT_TRANSIMIT_ONLY -#define ENDPOINT6_CONFIG ENDPOINT_TRANSIMIT_ONLY @@ -74,3 +68,4 @@ #endif + diff -r ef802d786748 -r 3d4cf158742e USB/pjrc/arm/usb_dev.c --- a/USB/pjrc/arm/usb_dev.c Fri Feb 01 21:19:31 2013 -0500 +++ b/USB/pjrc/arm/usb_dev.c Fri Feb 01 23:35:12 2013 -0500 @@ -245,7 +245,7 @@ #endif // TODO: this does not work... why? -#if defined(SEREMU_INTERFACE) || defined(KEYBOARD_INTERFACE) +#if defined(KEYBOARD_INTERFACE) case 0x0921: // HID SET_REPORT //serial_print(":)\n"); return; @@ -379,8 +379,9 @@ } //serial_phex32(*(uint32_t *)usb_cdc_line_coding); //serial_print("\n"); - // TODO - Fix this warning - if (*(uint32_t *)usb_cdc_line_coding == 134) usb_reboot_timer = 15; + // XXX - Not sure why this was casted to uint32_t... -HaaTa + //if (*(uint32_t *)usb_cdc_line_coding == 134) usb_reboot_timer = 15; + if (*usb_cdc_line_coding == 134) usb_reboot_timer = 15; endpoint0_transmit(NULL, 0); } #endif @@ -864,4 +865,3 @@ return usb_configuration; } - diff -r ef802d786748 -r 3d4cf158742e USB/pjrc/arm/usb_dev.h --- a/USB/pjrc/arm/usb_dev.h Fri Feb 01 21:19:31 2013 -0500 +++ b/USB/pjrc/arm/usb_dev.h Fri Feb 01 23:35:12 2013 -0500 @@ -28,11 +28,6 @@ extern void usb_serial_flush_callback(void); #endif -#ifdef SEREMU_INTERFACE -extern volatile uint8_t usb_seremu_transmit_flush_timer; -extern void usb_seremu_flush_callback(void); -#endif - #endif diff -r ef802d786748 -r 3d4cf158742e USB/pjrc/arm/usb_serial.c --- a/USB/pjrc/arm/usb_serial.c Fri Feb 01 21:19:31 2013 -0500 +++ b/USB/pjrc/arm/usb_serial.c Fri Feb 01 23:35:12 2013 -0500 @@ -237,12 +237,5 @@ //serial_print("usb_flush_callback end\n"); } - - - - +#endif // CDC_STATUS_INTERFACE && CDC_DATA_INTERFACE - - - -#endif // CDC_STATUS_INTERFACE && CDC_DATA_INTERFACE diff -r ef802d786748 -r 3d4cf158742e setup.cmake --- a/setup.cmake Fri Feb 01 21:19:31 2013 -0500 +++ b/setup.cmake Fri Feb 01 23:35:12 2013 -0500 @@ -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 "FACOM6684" ) +set( ScanModule "MBC-55X" ) ##| Uses the key index and potentially applies special conditions to it, mapping it to a usb key code set( MacroModule "buffer" ) @@ -68,8 +68,8 @@ if ( ${mod_var} STREQUAL ${COMPILER_FAMILY} ) # Module found, no need to scan further return() - endif ( ${mod_var} STREQUAL ${COMPILER_FAMILY} ) - endforeach( mod_var ${ARGN} ) + endif () + endforeach() message( FATAL_ERROR "${ModulePath} does not support the ${COMPILER_FAMILY} family..." ) endfunction() @@ -108,11 +108,11 @@ foreach( item ${ARGN} ) # Set the path set( tmpSource ${tmpSource} "${SourcesPath}/${item}" ) - endforeach( item ) + endforeach() # Finalize by writing the new list back over the old one set( ${Output} ${tmpSource} ) -endmacro( PathPrepend ) +endmacro() #| Scan Module @@ -156,7 +156,7 @@ #| Attempt to call Git to get the branch, last commit date, and whether code modified since last commit #| Modified -#| Takes a bit of work to extract the "M " using CMake, and not using it if there are not modifications +#| Takes a bit of work to extract the "M " using CMake, and not using it if there are no modifications execute_process( COMMAND git status -s -uno --porcelain WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE Git_Modified_INFO