Changeset 1010
- Timestamp:
- 11/18/08 22:07:49 (7 weeks ago)
- Location:
- firmware/branches/cpp
- Files:
-
- 6 modified
-
core/usb/device/core/USBDCallbacks_Initialized.c (modified) (2 diffs)
-
core/usb/device/core/USBDCallbacks_RequestReceived.c (modified) (1 diff)
-
core/usb/device/core/USBD_UDP.c (modified) (5 diffs)
-
projects/heavy/config.h (modified) (1 diff)
-
projects/heavy/heavy.hzp (modified) (6 diffs)
-
projects/heavy/make_.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
firmware/branches/cpp/core/usb/device/core/USBDCallbacks_Initialized.c
r1006 r1010 37 37 // #include <aic/aic.h> 38 38 39 extern void ( UsbIsr_Wrapper )( void ); 40 39 41 //------------------------------------------------------------------------------ 40 42 // Exported function … … 49 51 #if defined(BOARD_USB_UDP) 50 52 // Configure and enable the UDP interrupt 51 AIC_ConfigureIT(AT91C_ID_UDP, 0, USBD_InterruptHandler); 52 AIC_EnableIT(AT91C_ID_UDP); 53 // AIC_ConfigureIT(AT91C_ID_UDP, 0, UsbIsr_Wrapper); 54 AT91C_BASE_AIC->AIC_IDCR = 1 << AT91C_ID_UDP; 55 // Configure mode and handler 56 AT91C_BASE_AIC->AIC_SMR[AT91C_ID_UDP] = AT91C_AIC_SRCTYPE_INT_HIGH_LEVEL | 3; 57 AT91C_BASE_AIC->AIC_SVR[AT91C_ID_UDP] = (unsigned int) UsbIsr_Wrapper; 58 59 // Clear interrupt 60 AT91C_BASE_AIC->AIC_ICCR = 1 << AT91C_ID_UDP; 61 // AIC_EnableIT(AT91C_ID_UDP); 62 AT91C_BASE_AIC->AIC_IECR = 1 << AT91C_ID_UDP; 53 63 54 64 #elif defined(BOARD_USB_UDPHS) 55 65 // Configure and enable the UDPHS interrupt 56 AIC_ConfigureIT(AT91C_ID_UDPHS, 0, U SBD_InterruptHandler);66 AIC_ConfigureIT(AT91C_ID_UDPHS, 0, UsbIsr_Wrapper); 57 67 AIC_EnableIT(AT91C_ID_UDPHS); 58 68 #else -
firmware/branches/cpp/core/usb/device/core/USBDCallbacks_RequestReceived.c
r1004 r1010 46 46 { 47 47 // Does nothing 48 (void)pRequest; 48 49 } 49 50 -
firmware/branches/cpp/core/usb/device/core/USBD_UDP.c
r1008 r1010 51 51 #include "USBGenericRequest.h" 52 52 53 #include "FreeRTOS.h" 54 53 55 #if defined(BOARD_USB_UDP) 54 56 … … 659 661 660 662 // Configure endpoint 661 SET_CSR(eptnum, (unsigned char)AT91C_UDP_EPEDS | (type << 8) | (direction << 10));663 SET_CSR(eptnum, AT91C_UDP_EPEDS | (type << 8) | (direction << 10)); 662 664 if (type == USBEndpointDescriptor_CONTROL) { 663 665 … … 666 668 667 669 // trace_LOG(trace_INFO, "CfgEpt%d ", eptnum); 670 } 671 672 void UsbIsr_Wrapper( void ) __attribute__ ((naked)); 673 674 void UsbIsr_Wrapper( void ) 675 { 676 /* Save the context of the interrupted task. */ 677 portSAVE_CONTEXT(); 678 679 /* Call the handler to do the work. This must be a separate 680 function to ensure the stack frame is set up correctly. */ 681 USBD_InterruptHandler(); 682 683 /* Restore the context of whichever task will execute next. */ 684 portRESTORE_CONTEXT(); 668 685 } 669 686 … … 1163 1180 #error Unsupported pull-up type. 1164 1181 #endif 1165 AT91C_BASE_PIOA->PIO_PER = AT91C_PIO_PA10;1166 AT91C_BASE_PIOA->PIO_ODR = AT91C_PIO_PA10;1167 1168 AT91C_BASE_PIOA->PIO_PER = AT91C_PIO_PA11;1169 AT91C_BASE_PIOA->PIO_OER = AT91C_PIO_PA11;1170 AT91C_BASE_PIOA->PIO_CODR = AT91C_PIO_PA11;1171 1182 } 1172 1183 … … 1234 1245 AT91C_BASE_UDP->UDP_IER = AT91C_UDP_WAKEUP; 1235 1246 1247 AT91C_BASE_PIOA->PIO_PER = AT91C_PIO_PA10; 1248 AT91C_BASE_PIOA->PIO_ODR = AT91C_PIO_PA10; 1249 AT91C_BASE_PIOA->PIO_PER = AT91C_PIO_PA11; 1250 AT91C_BASE_PIOA->PIO_OER = AT91C_PIO_PA11; 1251 AT91C_BASE_PIOA->PIO_CODR = AT91C_PIO_PA11; 1252 1236 1253 // Configure interrupts 1237 1254 USBDCallbacks_Initialized(); 1255 1256 AT91C_BASE_PIOA->PIO_SODR = AT91C_PIO_PA11; 1238 1257 } 1239 1258 -
firmware/branches/cpp/projects/heavy/config.h
r819 r1010 21 21 // Comment out the systems that you don't want to include in your build. 22 22 //---------------------------------------------------------------- 23 #define MAKE_CTRL_USB // enable the USB system23 //#define MAKE_CTRL_USB // enable the USB system 24 24 #define MAKE_CTRL_NETWORK // enable the Ethernet system 25 25 #define OSC // enable the OSC system -
firmware/branches/cpp/projects/heavy/heavy.hzp
r703 r1010 8 8 <configuration filter="c;cpp;cxx;cc;h;s;asm;inc" Name="Common" /> 9 9 <folder Name="Heavy" > 10 <file file_name="make.c" Name="make.c" />11 10 <file file_name="config.h" Name="config.h" /> 11 <file file_name="make_.cpp" Name="make_.cpp" /> 12 12 </folder> 13 13 <folder Name="Core" > … … 51 51 <configuration arm_instruction_set="ARM" Name="THUMB Flash Debug" /> 52 52 </file> 53 <file file_name="../../core/makingthings/serial2.c" Name="serial2.c" />54 <file file_name="../../core/makingthings/serial2.h" Name="serial2.h" />55 <file file_name="../../core/makingthings/serial2_internal.h" Name="serial2_internal.h" />56 <file file_name="../../core/makingthings/serial2_isr.c" Name="serial2_isr.c" >57 <configuration arm_instruction_set="ARM" Name="THUMB Flash Debug" />58 </file>59 53 <file file_name="../../core/makingthings/serial.c" Name="serial.c" /> 60 54 <file file_name="../../core/makingthings/serial.h" Name="serial.h" /> … … 78 72 <file file_name="../../core/makingthings/USB-CDC.c" Name="USB-CDC.c" /> 79 73 <file file_name="../../core/makingthings/USB-CDC.h" Name="USB-CDC.h" /> 74 <file file_name="../../core/makingthings/udpsocket.h" Name="udpsocket.h" /> 75 <file file_name="../../core/makingthings/io_cpp.cpp" Name="io_cpp.cpp" /> 76 <file file_name="../../core/makingthings/io_cpp.h" Name="io_cpp.h" /> 77 <file file_name="../../core/makingthings/led_.cpp" Name="led_.cpp" /> 78 <file file_name="../../core/makingthings/led_cpp.h" Name="led_cpp.h" /> 79 <file file_name="../../core/makingthings/osc_cpp.cpp" Name="osc_cpp.cpp" /> 80 <file file_name="../../core/makingthings/osc_cpp.h" Name="osc_cpp.h" /> 81 <file file_name="../../core/makingthings/rtos_.cpp" Name="rtos_.cpp" /> 82 <file file_name="../../core/makingthings/rtos_.h" Name="rtos_.h" /> 83 <file file_name="../../core/makingthings/tcpserver.cpp" Name="tcpserver.cpp" /> 84 <file file_name="../../core/makingthings/tcpserver.h" Name="tcpserver.h" /> 85 <file file_name="../../core/makingthings/tcpsocket.cpp" Name="tcpsocket.cpp" /> 86 <file file_name="../../core/makingthings/tcpsocket.h" Name="tcpsocket.h" /> 87 <file file_name="../../core/makingthings/udpsocket.cpp" Name="udpsocket.cpp" /> 88 <file file_name="../../core/makingthings/usb_.cpp" Name="usb_.cpp" /> 89 <file file_name="../../core/makingthings/usb_.h" Name="usb_.h" /> 80 90 </folder> 81 91 <folder Name="FreeRTOS" > … … 94 104 <file file_name="../../core/freertos/include/semphr.h" Name="semphr.h" /> 95 105 <file file_name="../../core/freertos/include/task.h" Name="task.h" /> 106 <file file_name="../../core/freertos/portable/GCC/ARM7_AT91SAM7S/AT91SAM7X256.h" Name="AT91SAM7X256.h" /> 96 107 </folder> 97 108 <folder Name="lwIP" > … … 134 145 <file file_name="../../core/startup/AT91SAM7_Startup.s" Name="AT91SAM7_Startup.s" /> 135 146 <file file_name="../../core/startup/AT91SAM7_Target.js" Name="AT91SAM7_Target.js" > 136 <configuration Name="Common" file_type="Reset Script" />137 </file>147 <configuration Name="Common" file_type="Reset Script" /> 148 </file> 138 149 <file file_name="../../core/startup/AT91SAM7S256_MemoryMap.xml" Name="AT91SAM7S256_MemoryMap.xml" /> 139 150 <file file_name="../../core/startup/crt0.s" Name="crt0.s" /> 140 151 <file file_name="../../core/startup/flash_placement.xml" Name="flash_placement.xml" /> 141 152 <file file_name="../../core/freertos/portable/GCC/ARM7_AT91SAM7S/AT91SAM7X256.h" Name="AT91SAM7X256.h" /> 153 </folder> 154 <folder Name="USB" > 155 <file file_name="../../core/usb/common/cdc/CDCSetControlLineStateRequest.c" Name="CDCSetControlLineStateRequest.c" /> 156 <file file_name="../../core/usb/common/cdc/CDCLineCoding.c" Name="CDCLineCoding.c" /> 157 <file file_name="../../core/usb/common/core/USBSetConfigurationRequest.c" Name="USBSetConfigurationRequest.c" /> 158 <file file_name="../../core/usb/common/core/USBConfigurationDescriptor.c" Name="USBConfigurationDescriptor.c" /> 159 <file file_name="../../core/usb/common/core/USBEndpointDescriptor.c" Name="USBEndpointDescriptor.c" /> 160 <file file_name="../../core/usb/common/core/USBFeatureRequest.c" Name="USBFeatureRequest.c" /> 161 <file file_name="../../core/usb/common/core/USBGenericDescriptor.c" Name="USBGenericDescriptor.c" /> 162 <file file_name="../../core/usb/common/core/USBGenericRequest.c" Name="USBGenericRequest.c" /> 163 <file file_name="../../core/usb/common/core/USBGetDescriptorRequest.c" Name="USBGetDescriptorRequest.c" /> 164 <file file_name="../../core/usb/common/core/USBInterfaceRequest.c" Name="USBInterfaceRequest.c" /> 165 <file file_name="../../core/usb/common/core/USBSetAddressRequest.c" Name="USBSetAddressRequest.c" /> 166 <file file_name="../../core/usb/device/cdc-serial/CDCDSerialDriverDescriptors.c" Name="CDCDSerialDriverDescriptors.c" /> 167 <file file_name="../../core/usb/device/cdc-serial/CDCDSerialDriver.c" Name="CDCDSerialDriver.c" /> 168 <file file_name="../../core/usb/device/core/USBDDriverCallbacks_InterfaceSettingChanged.c" Name="USBDDriverCallbacks_InterfaceSettingChanged.c" /> 169 <file file_name="../../core/usb/device/core/USBD_UDP.c" Name="USBD_UDP.c" > 170 <configuration arm_instruction_set="ARM" Name="THUMB Flash Debug" /> 171 </file> 172 <file file_name="../../core/usb/device/core/USBDCallbacks_Initialized.c" Name="USBDCallbacks_Initialized.c" /> 173 <file file_name="../../core/usb/device/core/USBDCallbacks_Reset.c" Name="USBDCallbacks_Reset.c" /> 174 <file file_name="../../core/usb/device/core/USBDCallbacks_Resumed.c" Name="USBDCallbacks_Resumed.c" /> 175 <file file_name="../../core/usb/device/core/USBDCallbacks_Suspended.c" Name="USBDCallbacks_Suspended.c" /> 176 <file file_name="../../core/usb/device/core/USBDDriver.c" Name="USBDDriver.c" /> 177 <file file_name="../../core/usb/device/core/USBDDriverCallbacks_ConfigurationChanged.c" Name="USBDDriverCallbacks_ConfigurationChanged.c" /> 142 178 </folder> 143 179 </folder> … … 164 200 <file file_name="../../libraries/webserver/webserver.h" Name="webserver.h" /> 165 201 <file file_name="../../libraries/webserver/webserver.c" Name="webserver.c" /> 202 <file file_name="../../libraries/appled/appled_cpp.h" Name="appled_cpp.h" /> 203 <file file_name="../../libraries/appled/appled_.cpp" Name="appled_.cpp" /> 166 204 </folder> 167 205 </folder> 168 206 <configuration arm_target_loader_reset_after_download="Yes" Target="AT91SAM7X256" build_intermediate_directory="intermediate" arm_simulator_memory_simulation_parameter="0x20000;0x4000" linker_memory_map_file="$(StudioDir)/targets/Atmel_AT91SAM7/AT91SAM7X256_MemoryMap.xml" target_reset_script="FLASHReset()" build_output_directory="output" arm_target_flash_loader_type="Comms Channel Loader" Name="THUMB Flash Debug" /> 169 207 <configuration Target="AT91SAM7X256" arm_simulator_memory_simulation_parameter="0x40000;0x10000" linker_memory_map_file="$(StudioDir)/targets/Atmel_AT91SAM7/AT91SAM7X256_MemoryMap.xml" c_user_include_directories=".;../controller/makingthings;../controller/makingthings/testing;../appboard/makingthings;../controller/freertos/include;../controller/lwip/src/include;../controller/lwip/contrib/port/FreeRTOS/AT91SAM7X;../controller/freertos/portable/GCC/ARM7_AT91SAM7S;../controller/lwip/src/include/ipv4" gcc_optimization_level="Optimize For Size" c_additional_options="-D CROSSWORKS_BUILD" build_debug_information="No" linker_printf_width_precision_supported="Yes" Name="THUMB Flash Release" /> 170 <configuration Target="AT91SAM7X256" arm_simulator_memory_simulation_parameter="0x40000;0x10000" linker_memory_map_file="$(StudioDir)/targets/Atmel_AT91SAM7/AT91SAM7X256_MemoryMap.xml" c_user_include_directories=".;../../core/makingthings;../../core/freertos/include;../../core/lwip/src/include;../../core/lwip/contrib/port/FreeRTOS/AT91SAM7X;../../core/freertos/portable/GCC/ARM7_AT91SAM7S;../../core/lwip/src/include/ipv4;../../libraries/appled;../../libraries/digitalin;../../libraries/digitalout;../../libraries/dipswitch;../../libraries/motor;../../libraries/pwmout;../../libraries/servo;../../libraries/stepper;../../libraries/webclient;../../libraries/webserver;../../libraries/xbee " gcc_optimization_level="None" c_additional_options="-D CROSSWORKS_BUILD" linker_printf_width_precision_supported="Yes" Name="THUMB Flash Debug" />208 <configuration Target="AT91SAM7X256" arm_simulator_memory_simulation_parameter="0x40000;0x10000" linker_memory_map_file="$(StudioDir)/targets/Atmel_AT91SAM7/AT91SAM7X256_MemoryMap.xml" c_user_include_directories=".;../../core/makingthings;../../core/freertos/include;../../core/lwip/src/include;../../core/lwip/contrib/port/FreeRTOS/AT91SAM7X;../../core/freertos/portable/GCC/ARM7_AT91SAM7S;../../core/lwip/src/include/ipv4;../../libraries/appled;../../libraries/digitalin;../../libraries/digitalout;../../libraries/dipswitch;../../libraries/motor;../../libraries/pwmout;../../libraries/servo;../../libraries/stepper;../../libraries/webclient;../../libraries/webserver;../../libraries/xbee;../../core/usb/device/cdc-serial;../../core/usb/device/core;../../core/usb/common/cdc;../../core/usb/common/core" gcc_optimization_level="None" c_additional_options="-D CROSSWORKS_BUILD" linker_printf_width_precision_supported="Yes" Name="THUMB Flash Debug" /> 171 209 </project> 172 <configuration build_intermediate_directory="intermediate" build_ quietly="Yes" link_use_multi_threaded_libraries="No" inherited_configurations="THUMB;Flash;Debug" arm_linker_fiq_stack_size="256" build_output_directory="output" gcc_optimization_level="None" c_additional_options="-fomit-frame-pointer" arm_linker_stack_size="256" Name="THUMB Flash Debug" arm_linker_svc_stack_size="256" arm_linker_heap_size="512" />210 <configuration build_intermediate_directory="intermediate" build_remove_unused_symbols="No" build_quietly="Yes" link_use_multi_threaded_libraries="No" inherited_configurations="THUMB;Flash;Debug" arm_linker_fiq_stack_size="256" build_output_directory="output" gcc_optimization_level="None" c_additional_options="-fomit-frame-pointer" arm_linker_stack_size="256" Name="THUMB Flash Debug" arm_linker_svc_stack_size="256" arm_linker_heap_size="512" /> 173 211 <configuration arm_library_instruction_set="THUMB" c_preprocessor_definitions="__THUMB" arm_instruction_set="THUMB" hidden="Yes" Name="THUMB" /> 174 212 <configuration c_preprocessor_definitions="__FLASH_BUILD" hidden="Yes" Name="Flash" /> -
firmware/branches/cpp/projects/heavy/make_.cpp
r1008 r1010 40 40 41 41 // Fire up the OSC system and register the subsystems you want to use 42 Osc_SetActive( true, true, true, true );43 // make sure OSC_SUBSYSTEM_COUNT (osc.h) is large enough to accomodate them all44 //Osc_RegisterSubsystem( AppLedOsc_GetName(), AppLedOsc_ReceiveMessage, NULL );45 Osc_RegisterSubsystem( DipSwitchOsc_GetName(), DipSwitchOsc_ReceiveMessage, DipSwitchOsc_Async );46 Osc_RegisterSubsystem( ServoOsc_GetName(), ServoOsc_ReceiveMessage, NULL );47 Osc_RegisterSubsystem( AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, AnalogInOsc_Async );48 Osc_RegisterSubsystem( DigitalOutOsc_GetName(), DigitalOutOsc_ReceiveMessage, NULL );49 Osc_RegisterSubsystem( DigitalInOsc_GetName(), DigitalInOsc_ReceiveMessage, NULL );50 Osc_RegisterSubsystem( MotorOsc_GetName(), MotorOsc_ReceiveMessage, NULL );51 Osc_RegisterSubsystem( PwmOutOsc_GetName(), PwmOutOsc_ReceiveMessage, NULL );52 //Osc_RegisterSubsystem( LedOsc_GetName(), LedOsc_ReceiveMessage, NULL );53 Osc_RegisterSubsystem( DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL );54 Osc_RegisterSubsystem( SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL );55 Osc_RegisterSubsystem( NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL );56 Osc_RegisterSubsystem( SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL );57 Osc_RegisterSubsystem( IoOsc_GetName(), IoOsc_ReceiveMessage, NULL );58 Osc_RegisterSubsystem( StepperOsc_GetName(), StepperOsc_ReceiveMessage, NULL );59 Osc_RegisterSubsystem( XBeeOsc_GetName(), XBeeOsc_ReceiveMessage, XBeeOsc_Async );60 Osc_RegisterSubsystem( XBeeConfigOsc_GetName(), XBeeConfigOsc_ReceiveMessage, NULL );61 Osc_RegisterSubsystem( WebServerOsc_GetName(), WebServerOsc_ReceiveMessage, NULL );42 // Osc_SetActive( true, true, true, true ); 43 // // make sure OSC_SUBSYSTEM_COUNT (osc.h) is large enough to accomodate them all 44 // //Osc_RegisterSubsystem( AppLedOsc_GetName(), AppLedOsc_ReceiveMessage, NULL ); 45 // Osc_RegisterSubsystem( DipSwitchOsc_GetName(), DipSwitchOsc_ReceiveMessage, DipSwitchOsc_Async ); 46 // Osc_RegisterSubsystem( ServoOsc_GetName(), ServoOsc_ReceiveMessage, NULL ); 47 // Osc_RegisterSubsystem( AnalogInOsc_GetName(), AnalogInOsc_ReceiveMessage, AnalogInOsc_Async ); 48 // Osc_RegisterSubsystem( DigitalOutOsc_GetName(), DigitalOutOsc_ReceiveMessage, NULL ); 49 // Osc_RegisterSubsystem( DigitalInOsc_GetName(), DigitalInOsc_ReceiveMessage, NULL ); 50 // Osc_RegisterSubsystem( MotorOsc_GetName(), MotorOsc_ReceiveMessage, NULL ); 51 // Osc_RegisterSubsystem( PwmOutOsc_GetName(), PwmOutOsc_ReceiveMessage, NULL ); 52 // //Osc_RegisterSubsystem( LedOsc_GetName(), LedOsc_ReceiveMessage, NULL ); 53 // Osc_RegisterSubsystem( DebugOsc_GetName(), DebugOsc_ReceiveMessage, NULL ); 54 // Osc_RegisterSubsystem( SystemOsc_GetName(), SystemOsc_ReceiveMessage, NULL ); 55 // Osc_RegisterSubsystem( NetworkOsc_GetName(), NetworkOsc_ReceiveMessage, NULL ); 56 // Osc_RegisterSubsystem( SerialOsc_GetName(), SerialOsc_ReceiveMessage, NULL ); 57 // Osc_RegisterSubsystem( IoOsc_GetName(), IoOsc_ReceiveMessage, NULL ); 58 // Osc_RegisterSubsystem( StepperOsc_GetName(), StepperOsc_ReceiveMessage, NULL ); 59 // Osc_RegisterSubsystem( XBeeOsc_GetName(), XBeeOsc_ReceiveMessage, XBeeOsc_Async ); 60 // Osc_RegisterSubsystem( XBeeConfigOsc_GetName(), XBeeConfigOsc_ReceiveMessage, NULL ); 61 // Osc_RegisterSubsystem( WebServerOsc_GetName(), WebServerOsc_ReceiveMessage, NULL ); 62 62 63 63 // Starts the network up. Will not return until a network is found...
