├── .gitignore ├── 2021舵轮步兵 ├── APP │ ├── FreeRTOS_Init.c │ ├── FreeRTOS_Init.h │ ├── GO.c │ ├── GO.h │ ├── iwdg.c │ ├── iwdg.h │ ├── main.c │ ├── stm32f4xx_conf.h │ ├── stm32f4xx_it.c │ ├── stm32f4xx_it.h │ ├── system.c │ ├── system.h │ ├── zigbee_upper.c │ └── zigbee_upper.h ├── BSP │ ├── AUTO.c │ ├── AUTO.h │ ├── BUFF.c │ ├── BUFF.h │ ├── CUSUI.c │ ├── CUSUI.h │ ├── Device.h │ ├── Driver.h │ ├── Function.h │ ├── PID.c │ ├── PID.h │ ├── SinCosTable.c │ ├── SinCosTable.h │ ├── Sonic.c │ ├── Sonic.h │ ├── TIM.c │ ├── TIM.h │ ├── can1.c │ ├── can1.h │ ├── can2.c │ ├── can2.h │ ├── chassis.c │ ├── chassis.h │ ├── crc.c │ ├── crc.h │ ├── gimbal.c │ ├── gimbal.h │ ├── kalman.c │ ├── kalman.h │ ├── led.c │ ├── led.h │ ├── masters_RTX.c │ ├── masters_RTX.h │ ├── module.c │ ├── module.h │ ├── motor.c │ ├── motor.h │ ├── my_imu.c │ ├── my_imu.h │ ├── pwm.c │ ├── pwm.h │ ├── referee.c │ ├── referee.h │ ├── remote.c │ ├── remote.h │ ├── rifle.c │ ├── rifle.h │ ├── rudder.c │ ├── rudder.h │ ├── system_state.c │ ├── system_state.h │ ├── uart1.c │ ├── uart1.h │ ├── uart3.c │ ├── uart3.h │ ├── uart4.c │ ├── uart4.h │ ├── vision.c │ └── vision.h ├── FreeRTOS │ ├── croutine.c │ ├── event_groups.c │ ├── include │ │ ├── FreeRTOS.h │ │ ├── FreeRTOSConfig.h │ │ ├── StackMacros.h │ │ ├── croutine.h │ │ ├── deprecated_definitions.h │ │ ├── event_groups.h │ │ ├── list.h │ │ ├── message_buffer.h │ │ ├── mpu_prototypes.h │ │ ├── mpu_wrappers.h │ │ ├── portable.h │ │ ├── projdefs.h │ │ ├── queue.h │ │ ├── queue.h~RF2c4a8c07.TMP │ │ ├── queue.h~RF624eaf.TMP │ │ ├── queue.h~RF6ee9390.TMP │ │ ├── semphr.h │ │ ├── stack_macros.h │ │ ├── stdint.readme │ │ ├── stream_buffer.h │ │ ├── task.h │ │ ├── timers.h │ │ └── timers.h~RF528c24.TMP │ ├── list.c │ ├── portable │ │ ├── Keil │ │ │ └── See-also-the-RVDS-directory.txt │ │ ├── MemMang │ │ │ ├── ReadMe.url │ │ │ ├── heap_1.c │ │ │ ├── heap_2.c │ │ │ ├── heap_3.c │ │ │ ├── heap_4.c │ │ │ └── heap_5.c │ │ ├── RVDS │ │ │ ├── ARM7_LPC21xx │ │ │ │ ├── port.c │ │ │ │ ├── portASM.s │ │ │ │ ├── portmacro.h │ │ │ │ └── portmacro.inc │ │ │ ├── ARM_CA9 │ │ │ │ ├── port.c │ │ │ │ ├── portASM.s │ │ │ │ ├── portmacro.h │ │ │ │ └── portmacro.inc │ │ │ ├── ARM_CM0 │ │ │ │ ├── port.c │ │ │ │ └── portmacro.h │ │ │ ├── ARM_CM3 │ │ │ │ ├── port.c │ │ │ │ └── portmacro.h │ │ │ ├── ARM_CM4F │ │ │ │ ├── port.c │ │ │ │ └── portmacro.h │ │ │ ├── ARM_CM4_MPU │ │ │ │ ├── port.c │ │ │ │ └── portmacro.h │ │ │ └── ARM_CM7 │ │ │ │ ├── ReadMe.txt │ │ │ │ └── r0p1 │ │ │ │ ├── port.c │ │ │ │ └── portmacro.h │ │ └── readme.txt │ ├── queue.c │ ├── readme.txt │ ├── stream_buffer.c │ ├── tasks.c │ └── timers.c ├── IMU-BMI270 │ ├── bmi.c │ ├── bmi.h │ ├── bmi2.c │ ├── bmi2.h │ ├── bmi270.c │ ├── bmi270.h │ ├── bmi270_context.c │ ├── bmi270_context.h │ ├── bmi2_common.c │ ├── bmi2_common.h │ ├── bmi2_defs.h │ ├── bmi2_ois.c │ └── bmi2_ois.h ├── IMU-mpu6050 │ ├── eMPL │ │ ├── dmpKey.h │ │ ├── dmpmap.h │ │ ├── inv_mpu.c │ │ ├── inv_mpu.h │ │ ├── inv_mpu_dmp_motion_driver.c │ │ └── inv_mpu_dmp_motion_driver.h │ ├── iic.c │ ├── iic.h │ ├── mpu6050.c │ ├── mpu6050.h │ ├── myiic.c │ └── myiic.h ├── Libraries │ ├── Device │ │ ├── arm_mat_add_f32.c │ │ ├── arm_mat_cmplx_mult_f32.c │ │ ├── arm_mat_init_f32.c │ │ ├── arm_mat_inverse_f32.c │ │ ├── arm_mat_inverse_f64.c │ │ ├── arm_mat_mult_f32.c │ │ ├── arm_mat_scale_f32.c │ │ ├── arm_mat_sub_f32.c │ │ └── arm_mat_trans_f32.c │ ├── cmsis │ │ ├── Include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm4_simd.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ │ ├── stm32f4xx.h │ │ ├── system_stm32f4xx.c │ │ └── system_stm32f4xx.h │ ├── inc │ │ ├── misc.h │ │ ├── stm32f4xx_adc.h │ │ ├── stm32f4xx_can.h │ │ ├── stm32f4xx_crc.h │ │ ├── stm32f4xx_cryp.h │ │ ├── stm32f4xx_dac.h │ │ ├── stm32f4xx_dbgmcu.h │ │ ├── stm32f4xx_dcmi.h │ │ ├── stm32f4xx_dma.h │ │ ├── stm32f4xx_dma2d.h │ │ ├── stm32f4xx_exti.h │ │ ├── stm32f4xx_flash.h │ │ ├── stm32f4xx_fmc.h │ │ ├── stm32f4xx_fsmc.h │ │ ├── stm32f4xx_gpio.h │ │ ├── stm32f4xx_hash.h │ │ ├── stm32f4xx_i2c.h │ │ ├── stm32f4xx_iwdg.h │ │ ├── stm32f4xx_ltdc.h │ │ ├── stm32f4xx_pwr.h │ │ ├── stm32f4xx_rcc.h │ │ ├── stm32f4xx_rng.h │ │ ├── stm32f4xx_rtc.h │ │ ├── stm32f4xx_sai.h │ │ ├── stm32f4xx_sdio.h │ │ ├── stm32f4xx_spi.h │ │ ├── stm32f4xx_syscfg.h │ │ ├── stm32f4xx_tim.h │ │ ├── stm32f4xx_usart.h │ │ └── stm32f4xx_wwdg.h │ ├── src │ │ ├── misc.c │ │ ├── stm32f4xx_adc.c │ │ ├── stm32f4xx_can.c │ │ ├── stm32f4xx_crc.c │ │ ├── stm32f4xx_cryp.c │ │ ├── stm32f4xx_cryp_aes.c │ │ ├── stm32f4xx_cryp_des.c │ │ ├── stm32f4xx_cryp_tdes.c │ │ ├── stm32f4xx_dac.c │ │ ├── stm32f4xx_dbgmcu.c │ │ ├── stm32f4xx_dcmi.c │ │ ├── stm32f4xx_dma.c │ │ ├── stm32f4xx_dma2d.c │ │ ├── stm32f4xx_exti.c │ │ ├── stm32f4xx_flash.c │ │ ├── stm32f4xx_fmc.c │ │ ├── stm32f4xx_fsmc.c │ │ ├── stm32f4xx_gpio.c │ │ ├── stm32f4xx_hash.c │ │ ├── stm32f4xx_hash_md5.c │ │ ├── stm32f4xx_hash_sha1.c │ │ ├── stm32f4xx_i2c.c │ │ ├── stm32f4xx_iwdg.c │ │ ├── stm32f4xx_ltdc.c │ │ ├── stm32f4xx_pwr.c │ │ ├── stm32f4xx_rcc.c │ │ ├── stm32f4xx_rng.c │ │ ├── stm32f4xx_rtc.c │ │ ├── stm32f4xx_sai.c │ │ ├── stm32f4xx_sdio.c │ │ ├── stm32f4xx_spi.c │ │ ├── stm32f4xx_syscfg.c │ │ ├── stm32f4xx_tim.c │ │ ├── stm32f4xx_usart.c │ │ └── stm32f4xx_wwdg.c │ └── startup │ │ └── startup_stm32f40xx.s ├── Project │ ├── DebugConfig │ │ ├── Target_1_STM32F405RG.dbgconf │ │ ├── Target_1_STM32F405RGTx.dbgconf │ │ ├── Target_1_STM32F407VETx.dbgconf │ │ └── Target_1_STM32F407VG.dbgconf │ ├── EventRecorderStub.scvd │ ├── JLinkLog.txt │ ├── JLinkSettings.ini │ ├── Listings │ │ └── startup_stm32f40xx.lst │ ├── Objects │ │ ├── ExtDll.iex │ │ ├── arm_mat_add_f32.crf │ │ ├── arm_mat_init_f32.crf │ │ ├── arm_mat_inverse_f32.crf │ │ ├── arm_mat_inverse_f64.crf │ │ ├── arm_mat_mult_f32.crf │ │ ├── arm_mat_scale_f32.crf │ │ ├── arm_mat_sub_f32.crf │ │ ├── arm_mat_trans_f32.crf │ │ ├── auto.crf │ │ ├── bmi.crf │ │ ├── bmi2.crf │ │ ├── bmi270.crf │ │ ├── bmi270_context.crf │ │ ├── bmi2_common.crf │ │ ├── bmi2_ois.crf │ │ ├── buff.crf │ │ ├── can1.crf │ │ ├── can2.crf │ │ ├── chassis.crf │ │ ├── control.crf │ │ ├── crc.crf │ │ ├── crc_1.crf │ │ ├── croutine.crf │ │ ├── cusui.crf │ │ ├── event_groups.crf │ │ ├── freertos_init.crf │ │ ├── gimbal.crf │ │ ├── go.crf │ │ ├── heap_4.crf │ │ ├── inv_mpu.crf │ │ ├── inv_mpu_dmp_motion_driver.crf │ │ ├── iwdg.crf │ │ ├── kalman.crf │ │ ├── led.crf │ │ ├── list.crf │ │ ├── main.crf │ │ ├── masters_rtx.crf │ │ ├── misc.crf │ │ ├── module.crf │ │ ├── motor.crf │ │ ├── mpu6050.crf │ │ ├── my_imu.crf │ │ ├── myiic.crf │ │ ├── pid.crf │ │ ├── port.crf │ │ ├── project.axf │ │ ├── project.build_log.htm │ │ ├── project.htm │ │ ├── project.lnp │ │ ├── project.sct │ │ ├── project_Target 1.dep │ │ ├── queue.crf │ │ ├── referee.crf │ │ ├── referee_1.crf │ │ ├── remote.crf │ │ ├── rifle.crf │ │ ├── rudder.crf │ │ ├── sincostable.crf │ │ ├── soft_iic.crf │ │ ├── sonic.crf │ │ ├── stm32f4xx_adc.crf │ │ ├── stm32f4xx_can.crf │ │ ├── stm32f4xx_dma.crf │ │ ├── stm32f4xx_exti.crf │ │ ├── stm32f4xx_flash.crf │ │ ├── stm32f4xx_gpio.crf │ │ ├── stm32f4xx_it.crf │ │ ├── stm32f4xx_iwdg.crf │ │ ├── stm32f4xx_rcc.crf │ │ ├── stm32f4xx_spi.crf │ │ ├── stm32f4xx_syscfg.crf │ │ ├── stm32f4xx_tim.crf │ │ ├── stm32f4xx_usart.crf │ │ ├── sys.crf │ │ ├── system.crf │ │ ├── system_state.crf │ │ ├── system_stm32f4xx.crf │ │ ├── tasks.crf │ │ ├── tim.crf │ │ ├── timers.crf │ │ ├── uart1.crf │ │ ├── uart3.crf │ │ ├── uart4.crf │ │ ├── usart.crf │ │ ├── usart2.crf │ │ ├── vision.crf │ │ └── zigbee_upper.crf │ ├── project.uvguix.Administrator │ ├── project.uvguix.LEGION │ ├── project.uvguix.hp │ ├── project.uvguix.lenovo │ ├── project.uvguix.miracle │ ├── project.uvguix.nolimits │ ├── project.uvguix.user │ ├── project.uvoptx │ └── project.uvprojx ├── SYSTEM │ ├── sys.c │ ├── sys.h │ ├── usart.c │ └── usart.h └── keilkilll.bat ├── LICENSE ├── README.en.md ├── README.md ├── doc ├── 步兵操作.pdf ├── 步兵操作.xmind └── 舵轮控制原理.docx └── picture ├── PID算法.png ├── PID算法图.png ├── Z按键为例.png ├── 代码目录.png ├── 代码目录2.png ├── 供电框图和裁判系统.png ├── 头文件.png ├── 按键状态枚举.png ├── 硬件框图--滑环.png ├── 程序架构.png ├── 系统控制命令捕捉.png ├── 舵轮Z轴合成算法.png ├── 舵轮左前轮解算试例.jpg ├── 舵轮控制原理文件.png ├── 软件框图.png └── 通信线路框图.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /2021舵轮步兵/APP/FreeRTOS_Init.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/FreeRTOS_Init.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/FreeRTOS_Init.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/FreeRTOS_Init.h -------------------------------------------------------------------------------- /2021舵轮步兵/APP/GO.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/GO.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/GO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/GO.h -------------------------------------------------------------------------------- /2021舵轮步兵/APP/iwdg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/iwdg.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/iwdg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/iwdg.h -------------------------------------------------------------------------------- /2021舵轮步兵/APP/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/main.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/stm32f4xx_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file GPIO/GPIO_IOToggle/stm32f4xx_conf.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 13-November-2013 7 | * @brief Library configuration file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __STM32F4xx_CONF_H 30 | #define __STM32F4xx_CONF_H 31 | 32 | /* Includes ------------------------------------------------------------------*/ 33 | /* Uncomment the line below to enable peripheral header file inclusion */ 34 | #include "stm32f4xx_gpio.h" 35 | #include "stm32f4xx_tim.h" 36 | #include "stm32f4xx_rcc.h" 37 | #include "stm32f4xx_adc.h" 38 | #include "stm32f4xx_can.h" 39 | #include "stm32f4xx_flash.h" 40 | #include "stm32f4xx_dma.h" 41 | #include "stm32f4xx_spi.h" 42 | #include "stm32f4xx_exti.h" 43 | #include "stm32f4xx_usart.h" 44 | #include "stm32f4xx_syscfg.h" 45 | #include "stm32f4xx_iwdg.h" 46 | #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ 47 | 48 | #if defined (STM32F429_439xx) 49 | #include "stm32f4xx_cryp.h" 50 | #include "stm32f4xx_hash.h" 51 | #include "stm32f4xx_rng.h" 52 | #include "stm32f4xx_can.h" 53 | #include "stm32f4xx_dac.h" 54 | #include "stm32f4xx_dcmi.h" 55 | #include "stm32f4xx_dma2d.h" 56 | #include "stm32f4xx_fmc.h" 57 | #include "stm32f4xx_ltdc.h" 58 | #include "stm32f4xx_sai.h" 59 | #endif /* STM32F429_439xx */ 60 | 61 | #if defined (STM32F427_437xx) 62 | #include "stm32f4xx_cryp.h" 63 | #include "stm32f4xx_hash.h" 64 | #include "stm32f4xx_rng.h" 65 | #include "stm32f4xx_can.h" 66 | #include "stm32f4xx_dac.h" 67 | #include "stm32f4xx_dcmi.h" 68 | #include "stm32f4xx_dma2d.h" 69 | #include "stm32f4xx_fmc.h" 70 | #include "stm32f4xx_sai.h" 71 | #endif /* STM32F427_437xx */ 72 | 73 | #if defined (STM32F40_41xxx) 74 | 75 | #endif /* STM32F40_41xxx */ 76 | 77 | /* Exported types ------------------------------------------------------------*/ 78 | /* Exported constants --------------------------------------------------------*/ 79 | 80 | /* If an external clock source is used, then the value of the following define 81 | should be set to the value of the external clock source, else, if no external 82 | clock is used, keep this define commented */ 83 | /*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */ 84 | 85 | 86 | /* Uncomment the line below to expanse the "assert_param" macro in the 87 | Standard Peripheral Library drivers code */ 88 | /* #define USE_FULL_ASSERT 1 */ 89 | 90 | /* Exported macro ------------------------------------------------------------*/ 91 | #ifdef USE_FULL_ASSERT 92 | 93 | /** 94 | * @brief The assert_param macro is used for function's parameters check. 95 | * @param expr: If expr is false, it calls assert_failed function 96 | * which reports the name of the source file and the source 97 | * line number of the call that failed. 98 | * If expr is true, it returns no value. 99 | * @retval None 100 | */ 101 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 102 | /* Exported functions ------------------------------------------------------- */ 103 | void assert_failed(uint8_t* file, uint32_t line); 104 | #else 105 | #define assert_param(expr) ((void)0) 106 | #endif /* USE_FULL_ASSERT */ 107 | 108 | #endif /* __STM32F4xx_CONF_H */ 109 | 110 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 111 | -------------------------------------------------------------------------------- /2021舵轮步兵/APP/stm32f4xx_it.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/stm32f4xx_it.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file GPIO/GPIO_EXTI/Inc/stm32f4xx_it.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 26-June-2014 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2014 STMicroelectronics

12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | ****************************************************************************** 36 | */ 37 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ 39 | #ifndef __STM32F4xx_IT_H 40 | #define __STM32F4xx_IT_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | 47 | #include "stm32f4xx.h" 48 | 49 | /* Exported types ------------------------------------------------------------*/ 50 | /* Exported constants --------------------------------------------------------*/ 51 | /* Exported macro ------------------------------------------------------------*/ 52 | /* Exported functions ------------------------------------------------------- */ 53 | 54 | void NMI_Handler(void); 55 | void HardFault_Handler(void); 56 | void MemManage_Handler(void); 57 | void BusFault_Handler(void); 58 | void UsageFault_Handler(void); 59 | void SVC_Handler(void); 60 | void DebugMon_Handler(void); 61 | void PendSV_Handler(void); 62 | void SysTick_Handler(void); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* __STM32F4xx_IT_H */ 69 | 70 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 71 | -------------------------------------------------------------------------------- /2021舵轮步兵/APP/system.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/system.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/system.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/system.h -------------------------------------------------------------------------------- /2021舵轮步兵/APP/zigbee_upper.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/zigbee_upper.c -------------------------------------------------------------------------------- /2021舵轮步兵/APP/zigbee_upper.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/APP/zigbee_upper.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/AUTO.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/AUTO.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/AUTO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/AUTO.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/BUFF.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/BUFF.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/BUFF.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/BUFF.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/CUSUI.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/CUSUI.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/CUSUI.h: -------------------------------------------------------------------------------- 1 | #ifndef __CUSUI_H 2 | #define __CUSUI_H 3 | 4 | #include "system.h" 5 | 6 | 7 | typedef struct 8 | { 9 | uint8_t SPIN; 10 | uint8_t CLIP; 11 | uint8_t AUTO; 12 | uint8_t BlockMuch; 13 | uint8_t Shoot_heat_limit; 14 | uint8_t Bullet_Warning; 15 | float Vcap_show; 16 | 17 | }User_CMD_t; 18 | 19 | 20 | typedef struct 21 | { 22 | bool IF_Init_Over; 23 | User_CMD_t User; 24 | }UI_Info_t; 25 | 26 | void Startjudge_task(void); 27 | 28 | 29 | #endif 30 | 31 | 32 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/Device.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/Device.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/Driver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/Driver.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/Function.h: -------------------------------------------------------------------------------- 1 | #ifndef __FUNCTION_H 2 | #define __FUNCTION_H 3 | 4 | /* Function */ 5 | #include "vision.h" 6 | #include "AUTO.h" 7 | #include "BUFF.h" 8 | 9 | 10 | 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/PID.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/PID.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/PID.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/PID.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/SinCosTable.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/SinCosTable.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/SinCosTable.h: -------------------------------------------------------------------------------- 1 | #ifndef _SineTable_h_ 2 | #define _SineTable_h_ 3 | 4 | /* constants */ 5 | //#define TableSize 8193 6 | //#define pi 3.141592653 7 | //#define TWO_PI 6.283185306 8 | //#define HALF_PI 1.5707963265 9 | 10 | /* the LUT */ 11 | extern const float sintable[8193]; 12 | extern const float costable[8193]; 13 | /* public f(x) */ 14 | //extern float lookup_sin (float x); 15 | //extern float lookup_cos (float x); 16 | //extern float lookup_tan (float x); 17 | //extern float lookup_cot (float x); 18 | 19 | #endif // _SineTable_h_ 20 | 21 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/Sonic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/Sonic.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/Sonic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/Sonic.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/TIM.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/TIM.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/TIM.h: -------------------------------------------------------------------------------- 1 | #ifndef __TIM_H 2 | #define __TIM_H 3 | 4 | #include "system.h" 5 | 6 | typedef enum 7 | { 8 | up = 0, 9 | down = 1, 10 | }KEY_STATE_t; 11 | 12 | #define KEY_Left GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_0) 13 | #define KEY_Righ GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_1) 14 | 15 | void PWM_Friction_Init(u16 arr,u16 psc); 16 | void PWM_Clip_Init(u16 arr,u16 psc); 17 | void Trigger_Cnt_Init(u16 arr,u16 psc); 18 | void KEY_Init(void); 19 | void KEY_SCAN(void); 20 | bool Report_IF_TurnLeft_allow(void); 21 | bool Report_IF_TurnRigh_allow(void); 22 | #endif 23 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/can1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/can1.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/can1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/can1.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/can2.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/can2.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/can2.h: -------------------------------------------------------------------------------- 1 | #ifndef __CAN2_H__ 2 | #define __CAN2_H__ 3 | 4 | #include "Driver.h" 5 | 6 | extern uint32_t CAN2_time; 7 | 8 | /*CAN2*/ 9 | #if (NEW_CTRL == 0) 10 | #define CAN2_IO_CLOCK RCC_AHB1Periph_GPIOB 11 | #define CAN2_CLOCK RCC_APB1Periph_CAN2 12 | #define CAN2_IO_L GPIO_Pin_12 13 | #define CAN2_IO_H GPIO_Pin_13 14 | #define CAN2_IO_PinSource_L GPIO_PinSource12 15 | #define CAN2_IO_PinSource_H GPIO_PinSource13 16 | #define CAN2_IO_Port GPIOB 17 | 18 | #elif (NEW_CTRL == 1) 19 | #define CAN2_IO_CLOCK RCC_AHB1Periph_GPIOB 20 | #define CAN2_CLOCK RCC_APB1Periph_CAN2 21 | #define CAN2_IO_L GPIO_Pin_5 22 | #define CAN2_IO_H GPIO_Pin_6 23 | #define CAN2_IO_PinSource_L GPIO_PinSource5 24 | #define CAN2_IO_PinSource_H GPIO_PinSource6 25 | #define CAN2_IO_Port GPIOB 26 | #endif 27 | 28 | void CAN2_Init(void); 29 | void CAN2_Send(uint32_t Equipment_ID,int16_t *Data); 30 | bool Judge_IF_CAN2_Normal(void); 31 | uint8_t CAN2_DUM_Send(uint32_t Equipment_ID,uint8_t *Data); 32 | #define IF_CAN2_NORMAL Judge_IF_CAN2_Normal() 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/chassis.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/chassis.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/chassis.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/chassis.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/crc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/crc.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/crc.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRC_H__ 2 | #define __CRC_H__ 3 | 4 | #include "system.h" 5 | 6 | void CRC_init(void); 7 | unsigned char Get_CRC8_Check_Sum(unsigned char *pchMessage,unsigned int dwLength,unsigned char ucCRC8); 8 | unsigned int Verify_CRC8_Check_Sum(unsigned char *pchMessage, unsigned int dwLength); 9 | void Append_CRC8_Check_Sum(unsigned char *pchMessage, unsigned int dwLength); 10 | uint16_t Get_CRC16_Check_Sum(uint8_t *pchMessage,uint32_t dwLength,uint16_t wCRC); 11 | uint32_t Verify_CRC16_Check_Sum(uint8_t *pchMessage, uint32_t dwLength); 12 | void Append_CRC16_Check_Sum(uint8_t * pchMessage,uint32_t dwLength); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/gimbal.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/gimbal.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/gimbal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/gimbal.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/kalman.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/kalman.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/kalman.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/kalman.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/led.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/led.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/led.h: -------------------------------------------------------------------------------- 1 | #ifndef __LED_H 2 | #define __LED_H 3 | 4 | #include "system.h" 5 | 6 | typedef void (*Hint_LED_t)(void); 7 | extern Hint_LED_t Hint_LED; 8 | 9 | #define Green_On GPIO_ResetBits(GPIOC,GPIO_Pin_10) 10 | #define Green_Off GPIO_SetBits(GPIOC,GPIO_Pin_10) 11 | #define LED_GREEN PCout(10) 12 | 13 | #define Red_On GPIO_ResetBits(GPIOC,GPIO_Pin_11) 14 | #define Red_Off GPIO_SetBits(GPIOC,GPIO_Pin_11) 15 | #define LED_RED PCout(11) 16 | 17 | #define Blue_On GPIO_ResetBits(GPIOC,GPIO_Pin_13) 18 | #define Blue_Off GPIO_SetBits(GPIOC,GPIO_Pin_13) 19 | #define LED_BLUE PCout(13) 20 | 21 | #define Orange_On GPIO_ResetBits(GPIOC,GPIO_Pin_14) 22 | #define Orange_Off GPIO_SetBits(GPIOC,GPIO_Pin_14) 23 | #define LED_ORANGE PCout(14) 24 | 25 | #define AimLED_Ctrl PDout(9) 26 | void Led_Init(void); 27 | void Hint_Led_Init(void); 28 | void AimLED_Init(void); 29 | void System_Alive_Hint(void); 30 | void RC_Lost_Hint(void); 31 | void RC_Err_Hint(void); 32 | void NMI_Handler_Hint(void); 33 | void HardFault_Handler_Hint(void); 34 | void BusFault_Handler_Hint(void); 35 | void RC_Mode_Change_Hint(void); 36 | void System_LED_Hint(Hint_LED_t p); 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/masters_RTX.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/masters_RTX.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/masters_RTX.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/masters_RTX.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/module.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/module.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/module.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/motor.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/motor.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/motor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/motor.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/my_imu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/my_imu.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/my_imu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/my_imu.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/pwm.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/pwm.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/pwm.h: -------------------------------------------------------------------------------- 1 | #ifndef __PWM_H__ 2 | #define __PWM_H__ 3 | 4 | #include "system.h" 5 | 6 | void PWM1_Init(void); 7 | void PWM3_Init(void); 8 | void Friction_PWM(int16_t pwm1,int16_t pwm2); 9 | void Feeding_Bullet_PWM(int16_t pwm1); 10 | 11 | #define PWM1 TIM1->CCR2 12 | #define PWM2 TIM1->CCR1 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/referee.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/referee.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/referee.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/referee.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/remote.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/remote.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/remote.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/remote.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/rifle.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/rifle.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/rifle.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/rifle.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/rudder.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/rudder.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/rudder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/rudder.h -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/system_state.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/system_state.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/system_state.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_STATE_H 2 | #define __SYSTEM_STATE_H 3 | 4 | #include "system.h" 5 | 6 | 7 | void System_Normal_process(void); 8 | void system_state_Ctrl(void); 9 | void prev_sys_state_Err(System_State_t a); 10 | void Car_StateSync(CAR_ACT_FLAG_t *str); 11 | void User_StateSyne(User_state_t *str); 12 | #endif 13 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/uart1.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart1.h: -------------------------------------------------------------------------------- 1 | #ifndef __UART1_H 2 | #define __UART1_H 3 | 4 | #include "system.h" 5 | 6 | void USART1_Init( void ); 7 | void USART1_SendChar(uint8_t cData); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart3.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/uart3.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart3.h: -------------------------------------------------------------------------------- 1 | #ifndef __UART3_H 2 | #define __UART3_H 3 | 4 | #include "system.h" 5 | 6 | void USART3_Init( void ); 7 | void USART3_SendChar( uint8_t cData ); 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart4.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/uart4.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/uart4.h: -------------------------------------------------------------------------------- 1 | #ifndef __UART4_H 2 | #define __UART4_H 3 | 4 | #include "system.h" 5 | 6 | void UART4_Init( void ); 7 | void UART4_SendChar( uint8_t cData ); 8 | void UART4_DMA_SentData(uint8_t *cData , int size); 9 | 10 | 11 | 12 | 13 | /* 14 | A5 00 90 00 00 8E CD 18 45 A4 45 7B 45 AB 4D 15 | A5 00 90 00 00 2B 56 1D 45 8D 68 7B 00 00 00 16 | A5 00 90 00 00 68 40 1E 45 AF 62 7B 45 7A B7 17 | */ 18 | 19 | 20 | #endif 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/vision.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/vision.c -------------------------------------------------------------------------------- /2021舵轮步兵/BSP/vision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/BSP/vision.h -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/include/FreeRTOSConfig.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/FreeRTOS/include/FreeRTOSConfig.h -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/include/StackMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef STACK_MACROS_H 29 | #define STACK_MACROS_H 30 | 31 | #ifndef _MSC_VER /* Visual Studio doesn't support #warning. */ 32 | #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released. 33 | #endif 34 | 35 | /* 36 | * Call the stack overflow hook function if the stack of the task being swapped 37 | * out is currently overflowed, or looks like it might have overflowed in the 38 | * past. 39 | * 40 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check 41 | * the current stack state only - comparing the current top of stack value to 42 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 43 | * will also cause the last few stack bytes to be checked to ensure the value 44 | * to which the bytes were set when the task was created have not been 45 | * overwritten. Note this second test does not guarantee that an overflowed 46 | * stack will always be recognised. 47 | */ 48 | 49 | /*-----------------------------------------------------------*/ 50 | 51 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 52 | 53 | /* Only the current stack state is to be checked. */ 54 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 55 | { \ 56 | /* Is the currently saved stack pointer within the stack limit? */ \ 57 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 58 | { \ 59 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 60 | } \ 61 | } 62 | 63 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 64 | /*-----------------------------------------------------------*/ 65 | 66 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 67 | 68 | /* Only the current stack state is to be checked. */ 69 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 70 | { \ 71 | \ 72 | /* Is the currently saved stack pointer within the stack limit? */ \ 73 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 74 | { \ 75 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 76 | } \ 77 | } 78 | 79 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 80 | /*-----------------------------------------------------------*/ 81 | 82 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 83 | 84 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 85 | { \ 86 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 87 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 88 | \ 89 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ 90 | ( pulStack[ 1 ] != ulCheckValue ) || \ 91 | ( pulStack[ 2 ] != ulCheckValue ) || \ 92 | ( pulStack[ 3 ] != ulCheckValue ) ) \ 93 | { \ 94 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 95 | } \ 96 | } 97 | 98 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 99 | /*-----------------------------------------------------------*/ 100 | 101 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 102 | 103 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 104 | { \ 105 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 106 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 107 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 108 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 109 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 110 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 111 | \ 112 | \ 113 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 114 | \ 115 | /* Has the extremity of the task stack ever been written over? */ \ 116 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 117 | { \ 118 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 119 | } \ 120 | } 121 | 122 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 123 | /*-----------------------------------------------------------*/ 124 | 125 | /* Remove stack overflow macro if not being used. */ 126 | #ifndef taskCHECK_FOR_STACK_OVERFLOW 127 | #define taskCHECK_FOR_STACK_OVERFLOW() 128 | #endif 129 | 130 | 131 | 132 | #endif /* STACK_MACROS_H */ 133 | 134 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef PROJDEFS_H 29 | #define PROJDEFS_H 30 | 31 | /* 32 | * Defines the prototype to which task functions must conform. Defined in this 33 | * file to ensure the type is known before portable.h is included. 34 | */ 35 | typedef void (*TaskFunction_t)( void * ); 36 | 37 | /* Converts a time in milliseconds to a time in ticks. This macro can be 38 | overridden by a macro of the same name defined in FreeRTOSConfig.h in case the 39 | definition here is not suitable for your application. */ 40 | #ifndef pdMS_TO_TICKS 41 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) 42 | #endif 43 | 44 | #define pdFALSE ( ( BaseType_t ) 0 ) 45 | #define pdTRUE ( ( BaseType_t ) 1 ) 46 | 47 | #define pdPASS ( pdTRUE ) 48 | #define pdFAIL ( pdFALSE ) 49 | #define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) 50 | #define errQUEUE_FULL ( ( BaseType_t ) 0 ) 51 | 52 | /* FreeRTOS error definitions. */ 53 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 54 | #define errQUEUE_BLOCKED ( -4 ) 55 | #define errQUEUE_YIELD ( -5 ) 56 | 57 | /* Macros used for basic data corruption checks. */ 58 | #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 59 | #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 60 | #endif 61 | 62 | #if( configUSE_16_BIT_TICKS == 1 ) 63 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a 64 | #else 65 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL 66 | #endif 67 | 68 | /* The following errno values are used by FreeRTOS+ components, not FreeRTOS 69 | itself. */ 70 | #define pdFREERTOS_ERRNO_NONE 0 /* No errors */ 71 | #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ 72 | #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */ 73 | #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ 74 | #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ 75 | #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ 76 | #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ 77 | #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ 78 | #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ 79 | #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ 80 | #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ 81 | #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ 82 | #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ 83 | #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ 84 | #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ 85 | #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ 86 | #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ 87 | #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ 88 | #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ 89 | #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ 90 | #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ 91 | #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ 92 | #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ 93 | #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */ 94 | #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ 95 | #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ 96 | #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ 97 | #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ 98 | #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ 99 | #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ 100 | #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ 101 | #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */ 102 | #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */ 103 | #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ 104 | #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */ 105 | #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */ 106 | #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */ 107 | #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */ 108 | #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */ 109 | #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */ 110 | 111 | /* The following endian values are used by FreeRTOS+ components, not FreeRTOS 112 | itself. */ 113 | #define pdFREERTOS_LITTLE_ENDIAN 0 114 | #define pdFREERTOS_BIG_ENDIAN 1 115 | 116 | /* Re-defining endian values for generic naming. */ 117 | #define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN 118 | #define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN 119 | 120 | 121 | #endif /* PROJDEFS_H */ 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/include/stack_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef STACK_MACROS_H 29 | #define STACK_MACROS_H 30 | 31 | /* 32 | * Call the stack overflow hook function if the stack of the task being swapped 33 | * out is currently overflowed, or looks like it might have overflowed in the 34 | * past. 35 | * 36 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check 37 | * the current stack state only - comparing the current top of stack value to 38 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 39 | * will also cause the last few stack bytes to be checked to ensure the value 40 | * to which the bytes were set when the task was created have not been 41 | * overwritten. Note this second test does not guarantee that an overflowed 42 | * stack will always be recognised. 43 | */ 44 | 45 | /*-----------------------------------------------------------*/ 46 | 47 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 48 | 49 | /* Only the current stack state is to be checked. */ 50 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 51 | { \ 52 | /* Is the currently saved stack pointer within the stack limit? */ \ 53 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 54 | { \ 55 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 56 | } \ 57 | } 58 | 59 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 60 | /*-----------------------------------------------------------*/ 61 | 62 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 63 | 64 | /* Only the current stack state is to be checked. */ 65 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 66 | { \ 67 | \ 68 | /* Is the currently saved stack pointer within the stack limit? */ \ 69 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 70 | { \ 71 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 72 | } \ 73 | } 74 | 75 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 76 | /*-----------------------------------------------------------*/ 77 | 78 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 79 | 80 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 81 | { \ 82 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 83 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 84 | \ 85 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ 86 | ( pulStack[ 1 ] != ulCheckValue ) || \ 87 | ( pulStack[ 2 ] != ulCheckValue ) || \ 88 | ( pulStack[ 3 ] != ulCheckValue ) ) \ 89 | { \ 90 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 91 | } \ 92 | } 93 | 94 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 95 | /*-----------------------------------------------------------*/ 96 | 97 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 98 | 99 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 100 | { \ 101 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 102 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 103 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 104 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 105 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 106 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 107 | \ 108 | \ 109 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 110 | \ 111 | /* Has the extremity of the task stack ever been written over? */ \ 112 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 113 | { \ 114 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 115 | } \ 116 | } 117 | 118 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 119 | /*-----------------------------------------------------------*/ 120 | 121 | /* Remove stack overflow macro if not being used. */ 122 | #ifndef taskCHECK_FOR_STACK_OVERFLOW 123 | #define taskCHECK_FOR_STACK_OVERFLOW() 124 | #endif 125 | 126 | 127 | 128 | #endif /* STACK_MACROS_H */ 129 | 130 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/Keil/See-also-the-RVDS-directory.txt: -------------------------------------------------------------------------------- 1 | Nothing to see here. -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/MemMang/ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/a00111.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/MemMang/heap_1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | /* 30 | * The simplest possible implementation of pvPortMalloc(). Note that this 31 | * implementation does NOT allow allocated memory to be freed again. 32 | * 33 | * See heap_2.c, heap_3.c and heap_4.c for alternative implementations, and the 34 | * memory management pages of http://www.FreeRTOS.org for more information. 35 | */ 36 | #include 37 | 38 | /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining 39 | all the API functions to use the MPU wrappers. That should only be done when 40 | task.h is included from an application file. */ 41 | #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE 42 | 43 | #include "FreeRTOS.h" 44 | #include "task.h" 45 | 46 | #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE 47 | 48 | #if( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) 49 | #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 50 | #endif 51 | 52 | /* A few bytes might be lost to byte aligning the heap start address. */ 53 | #define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT ) 54 | 55 | /* Allocate the memory for the heap. */ 56 | #if( configAPPLICATION_ALLOCATED_HEAP == 1 ) 57 | /* The application writer has already defined the array used for the RTOS 58 | heap - probably so it can be placed in a special segment or address. */ 59 | extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; 60 | #else 61 | static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; 62 | #endif /* configAPPLICATION_ALLOCATED_HEAP */ 63 | 64 | /* Index into the ucHeap array. */ 65 | static size_t xNextFreeByte = ( size_t ) 0; 66 | 67 | /*-----------------------------------------------------------*/ 68 | 69 | void *pvPortMalloc( size_t xWantedSize ) 70 | { 71 | void *pvReturn = NULL; 72 | static uint8_t *pucAlignedHeap = NULL; 73 | 74 | /* Ensure that blocks are always aligned to the required number of bytes. */ 75 | #if( portBYTE_ALIGNMENT != 1 ) 76 | { 77 | if( xWantedSize & portBYTE_ALIGNMENT_MASK ) 78 | { 79 | /* Byte alignment required. */ 80 | xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ); 81 | } 82 | } 83 | #endif 84 | 85 | vTaskSuspendAll(); 86 | { 87 | if( pucAlignedHeap == NULL ) 88 | { 89 | /* Ensure the heap starts on a correctly aligned boundary. */ 90 | pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); 91 | } 92 | 93 | /* Check there is enough room left for the allocation. */ 94 | if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) && 95 | ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */ 96 | { 97 | /* Return the next free byte then increment the index past this 98 | block. */ 99 | pvReturn = pucAlignedHeap + xNextFreeByte; 100 | xNextFreeByte += xWantedSize; 101 | } 102 | 103 | traceMALLOC( pvReturn, xWantedSize ); 104 | } 105 | ( void ) xTaskResumeAll(); 106 | 107 | #if( configUSE_MALLOC_FAILED_HOOK == 1 ) 108 | { 109 | if( pvReturn == NULL ) 110 | { 111 | extern void vApplicationMallocFailedHook( void ); 112 | vApplicationMallocFailedHook(); 113 | } 114 | } 115 | #endif 116 | 117 | return pvReturn; 118 | } 119 | /*-----------------------------------------------------------*/ 120 | 121 | void vPortFree( void *pv ) 122 | { 123 | /* Memory cannot be freed using this scheme. See heap_2.c, heap_3.c and 124 | heap_4.c for alternative implementations, and the memory management pages of 125 | http://www.FreeRTOS.org for more information. */ 126 | ( void ) pv; 127 | 128 | /* Force an assert as it is invalid to call this function. */ 129 | configASSERT( pv == NULL ); 130 | } 131 | /*-----------------------------------------------------------*/ 132 | 133 | void vPortInitialiseBlocks( void ) 134 | { 135 | /* Only required when static memory is not cleared. */ 136 | xNextFreeByte = ( size_t ) 0; 137 | } 138 | /*-----------------------------------------------------------*/ 139 | 140 | size_t xPortGetFreeHeapSize( void ) 141 | { 142 | return ( configADJUSTED_HEAP_SIZE - xNextFreeByte ); 143 | } 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/MemMang/heap_3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | /* 30 | * Implementation of pvPortMalloc() and vPortFree() that relies on the 31 | * compilers own malloc() and free() implementations. 32 | * 33 | * This file can only be used if the linker is configured to to generate 34 | * a heap memory area. 35 | * 36 | * See heap_1.c, heap_2.c and heap_4.c for alternative implementations, and the 37 | * memory management pages of http://www.FreeRTOS.org for more information. 38 | */ 39 | 40 | #include 41 | 42 | /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining 43 | all the API functions to use the MPU wrappers. That should only be done when 44 | task.h is included from an application file. */ 45 | #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE 46 | 47 | #include "FreeRTOS.h" 48 | #include "task.h" 49 | 50 | #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE 51 | 52 | #if( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) 53 | #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 54 | #endif 55 | 56 | /*-----------------------------------------------------------*/ 57 | 58 | void *pvPortMalloc( size_t xWantedSize ) 59 | { 60 | void *pvReturn; 61 | 62 | vTaskSuspendAll(); 63 | { 64 | pvReturn = malloc( xWantedSize ); 65 | traceMALLOC( pvReturn, xWantedSize ); 66 | } 67 | ( void ) xTaskResumeAll(); 68 | 69 | #if( configUSE_MALLOC_FAILED_HOOK == 1 ) 70 | { 71 | if( pvReturn == NULL ) 72 | { 73 | extern void vApplicationMallocFailedHook( void ); 74 | vApplicationMallocFailedHook(); 75 | } 76 | } 77 | #endif 78 | 79 | return pvReturn; 80 | } 81 | /*-----------------------------------------------------------*/ 82 | 83 | void vPortFree( void *pv ) 84 | { 85 | if( pv ) 86 | { 87 | vTaskSuspendAll(); 88 | { 89 | free( pv ); 90 | traceFREE( pv, 0 ); 91 | } 92 | ( void ) xTaskResumeAll(); 93 | } 94 | } 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM7_LPC21xx/portASM.s: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V10.2.1 3 | ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | ; * this software and associated documentation files (the "Software"), to deal in 7 | ; * the Software without restriction, including without limitation the rights to 8 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 10 | ; * subject to the following conditions: 11 | ; * 12 | ; * The above copyright notice and this permission notice shall be included in all 13 | ; * copies or substantial portions of the Software. 14 | ; * 15 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | ; * 22 | ; * http://www.FreeRTOS.org 23 | ; * http://aws.amazon.com/freertos 24 | ; * 25 | ; * 1 tab == 4 spaces! 26 | ; */ 27 | 28 | INCLUDE portmacro.inc 29 | 30 | IMPORT vTaskSwitchContext 31 | IMPORT xTaskIncrementTick 32 | 33 | EXPORT vPortYieldProcessor 34 | EXPORT vPortStartFirstTask 35 | EXPORT vPreemptiveTick 36 | EXPORT vPortYield 37 | 38 | 39 | VICVECTADDR EQU 0xFFFFF030 40 | T0IR EQU 0xE0004000 41 | T0MATCHBIT EQU 0x00000001 42 | 43 | ARM 44 | AREA PORT_ASM, CODE, READONLY 45 | 46 | 47 | 48 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 49 | ; Starting the first task is done by just restoring the context 50 | ; setup by pxPortInitialiseStack 51 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 52 | vPortStartFirstTask 53 | 54 | PRESERVE8 55 | 56 | portRESTORE_CONTEXT 57 | 58 | vPortYield 59 | 60 | PRESERVE8 61 | 62 | SVC 0 63 | bx lr 64 | 65 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 66 | ; Interrupt service routine for the SWI interrupt. The vector table is 67 | ; configured in the startup.s file. 68 | ; 69 | ; vPortYieldProcessor() is used to manually force a context switch. The 70 | ; SWI interrupt is generated by a call to taskYIELD() or portYIELD(). 71 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 72 | 73 | vPortYieldProcessor 74 | 75 | PRESERVE8 76 | 77 | ; Within an IRQ ISR the link register has an offset from the true return 78 | ; address, but an SWI ISR does not. Add the offset manually so the same 79 | ; ISR return code can be used in both cases. 80 | ADD LR, LR, #4 81 | 82 | ; Perform the context switch. 83 | portSAVE_CONTEXT ; Save current task context 84 | LDR R0, =vTaskSwitchContext ; Get the address of the context switch function 85 | MOV LR, PC ; Store the return address 86 | BX R0 ; Call the contedxt switch function 87 | portRESTORE_CONTEXT ; restore the context of the selected task 88 | 89 | 90 | 91 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 92 | ; Interrupt service routine for preemptive scheduler tick timer 93 | ; Only used if portUSE_PREEMPTION is set to 1 in portmacro.h 94 | ; 95 | ; Uses timer 0 of LPC21XX Family 96 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 97 | 98 | vPreemptiveTick 99 | 100 | PRESERVE8 101 | 102 | portSAVE_CONTEXT ; Save the context of the current task. 103 | 104 | LDR R0, =xTaskIncrementTick ; Increment the tick count. 105 | MOV LR, PC ; This may make a delayed task ready 106 | BX R0 ; to run. 107 | 108 | CMP R0, #0 109 | BEQ SkipContextSwitch 110 | LDR R0, =vTaskSwitchContext ; Find the highest priority task that 111 | MOV LR, PC ; is ready to run. 112 | BX R0 113 | SkipContextSwitch 114 | MOV R0, #T0MATCHBIT ; Clear the timer event 115 | LDR R1, =T0IR 116 | STR R0, [R1] 117 | 118 | LDR R0, =VICVECTADDR ; Acknowledge the interrupt 119 | STR R0,[R0] 120 | 121 | portRESTORE_CONTEXT ; Restore the context of the highest 122 | ; priority task that is ready to run. 123 | END 124 | 125 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM7_LPC21xx/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /*----------------------------------------------------------- 37 | * Port specific definitions. 38 | * 39 | * The settings in this file configure FreeRTOS correctly for the 40 | * given hardware and compiler. 41 | * 42 | * These settings should not be altered. 43 | *----------------------------------------------------------- 44 | */ 45 | 46 | /* Type definitions. */ 47 | #define portCHAR char 48 | #define portFLOAT float 49 | #define portDOUBLE double 50 | #define portLONG long 51 | #define portSHORT short 52 | #define portSTACK_TYPE uint32_t 53 | #define portBASE_TYPE long 54 | 55 | typedef portSTACK_TYPE StackType_t; 56 | typedef long BaseType_t; 57 | typedef unsigned long UBaseType_t; 58 | 59 | 60 | #if( configUSE_16_BIT_TICKS == 1 ) 61 | typedef uint16_t TickType_t; 62 | #define portMAX_DELAY ( TickType_t ) 0xffff 63 | #else 64 | typedef uint32_t TickType_t; 65 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 66 | #endif 67 | /*-----------------------------------------------------------*/ 68 | 69 | /* Hardware specifics. */ 70 | #define portSTACK_GROWTH ( -1 ) 71 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 72 | #define portBYTE_ALIGNMENT 8 73 | /*-----------------------------------------------------------*/ 74 | 75 | /* Task utilities. */ 76 | 77 | /*----------------------------------------------------------- 78 | * ISR entry and exit macros. These are only required if a task switch 79 | * is required from an ISR. 80 | *----------------------------------------------------------*/ 81 | 82 | /* If a switch is required then we just need to call */ 83 | /* vTaskSwitchContext() as the context has already been */ 84 | /* saved. */ 85 | 86 | #define portEXIT_SWITCHING_ISR(SwitchRequired) \ 87 | { \ 88 | extern void vTaskSwitchContext(void); \ 89 | \ 90 | if(SwitchRequired) \ 91 | { \ 92 | vTaskSwitchContext(); \ 93 | } \ 94 | } \ 95 | 96 | extern void vPortYield( void ); 97 | #define portYIELD() vPortYield() 98 | 99 | 100 | /* Critical section management. */ 101 | 102 | /* 103 | ****************************************************************** 104 | * We don't need to worry about whether we're in ARM or 105 | * THUMB mode with the Keil Real View compiler when enabling 106 | * or disabling interrupts as the compiler's intrinsic functions 107 | * take care of that for us. 108 | ******************************************************************* 109 | */ 110 | #define portDISABLE_INTERRUPTS() __disable_irq() 111 | #define portENABLE_INTERRUPTS() __enable_irq() 112 | 113 | 114 | /*----------------------------------------------------------- 115 | * Critical section control 116 | * 117 | * The code generated by the Keil compiler does not maintain separate 118 | * stack and frame pointers. The portENTER_CRITICAL macro cannot therefore 119 | * use the stack as per other ports. Instead a variable is used to keep 120 | * track of the critical section nesting. This necessitates the use of a 121 | * function in place of the macro. 122 | *----------------------------------------------------------*/ 123 | 124 | extern void vPortEnterCritical( void ); 125 | extern void vPortExitCritical( void ); 126 | 127 | #define portENTER_CRITICAL() vPortEnterCritical(); 128 | #define portEXIT_CRITICAL() vPortExitCritical(); 129 | /*-----------------------------------------------------------*/ 130 | 131 | /* Compiler specifics. */ 132 | #define inline 133 | #define register 134 | #define portNOP() __asm{ NOP } 135 | /*-----------------------------------------------------------*/ 136 | 137 | /* Task function macros as described on the FreeRTOS.org WEB site. */ 138 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 139 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 140 | 141 | #ifdef __cplusplus 142 | } 143 | #endif 144 | 145 | #endif /* PORTMACRO_H */ 146 | 147 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM7_LPC21xx/portmacro.inc: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V10.2.1 3 | ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | ; * this software and associated documentation files (the "Software"), to deal in 7 | ; * the Software without restriction, including without limitation the rights to 8 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 10 | ; * subject to the following conditions: 11 | ; * 12 | ; * The above copyright notice and this permission notice shall be included in all 13 | ; * copies or substantial portions of the Software. 14 | ; * 15 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | ; * 22 | ; * http://www.FreeRTOS.org 23 | ; * http://aws.amazon.com/freertos 24 | ; * 25 | ; * 1 tab == 4 spaces! 26 | ; */ 27 | 28 | IMPORT ulCriticalNesting ; 29 | IMPORT pxCurrentTCB ; 30 | 31 | 32 | MACRO 33 | portRESTORE_CONTEXT 34 | 35 | 36 | LDR R0, =pxCurrentTCB ; Set the LR to the task stack. The location was... 37 | LDR R0, [R0] ; ... stored in pxCurrentTCB 38 | LDR LR, [R0] 39 | 40 | LDR R0, =ulCriticalNesting ; The critical nesting depth is the first item on... 41 | LDMFD LR!, {R1} ; ...the stack. Load it into the ulCriticalNesting var. 42 | STR R1, [R0] ; 43 | 44 | LDMFD LR!, {R0} ; Get the SPSR from the stack. 45 | MSR SPSR_cxsf, R0 ; 46 | 47 | LDMFD LR, {R0-R14}^ ; Restore all system mode registers for the task. 48 | NOP ; 49 | 50 | LDR LR, [LR, #+60] ; Restore the return address 51 | 52 | ; And return - correcting the offset in the LR to obtain ... 53 | SUBS PC, LR, #4 ; ...the correct address. 54 | 55 | MEND 56 | 57 | ; /**********************************************************************/ 58 | 59 | MACRO 60 | portSAVE_CONTEXT 61 | 62 | 63 | STMDB SP!, {R0} ; Store R0 first as we need to use it. 64 | 65 | STMDB SP,{SP}^ ; Set R0 to point to the task stack pointer. 66 | NOP ; 67 | SUB SP, SP, #4 ; 68 | LDMIA SP!,{R0} ; 69 | 70 | STMDB R0!, {LR} ; Push the return address onto the stack. 71 | MOV LR, R0 ; Now we have saved LR we can use it instead of R0. 72 | LDMIA SP!, {R0} ; Pop R0 so we can save it onto the system mode stack. 73 | 74 | STMDB LR,{R0-LR}^ ; Push all the system mode registers onto the task stack. 75 | NOP ; 76 | SUB LR, LR, #60 ; 77 | 78 | MRS R0, SPSR ; Push the SPSR onto the task stack. 79 | STMDB LR!, {R0} ; 80 | 81 | LDR R0, =ulCriticalNesting ; 82 | LDR R0, [R0] ; 83 | STMDB LR!, {R0} ; 84 | 85 | LDR R0, =pxCurrentTCB ; Store the new top of stack for the task. 86 | LDR R1, [R0] ; 87 | STR LR, [R1] ; 88 | 89 | MEND 90 | 91 | END 92 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM_CA9/portASM.s: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V10.2.1 3 | ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | ; * this software and associated documentation files (the "Software"), to deal in 7 | ; * the Software without restriction, including without limitation the rights to 8 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 10 | ; * subject to the following conditions: 11 | ; * 12 | ; * The above copyright notice and this permission notice shall be included in all 13 | ; * copies or substantial portions of the Software. 14 | ; * 15 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | ; * 22 | ; * http://www.FreeRTOS.org 23 | ; * http://aws.amazon.com/freertos 24 | ; * 25 | ; * 1 tab == 4 spaces! 26 | ; */ 27 | 28 | INCLUDE portmacro.inc 29 | 30 | IMPORT vApplicationIRQHandler 31 | IMPORT vTaskSwitchContext 32 | IMPORT ulPortYieldRequired 33 | IMPORT ulPortInterruptNesting 34 | IMPORT vTaskSwitchContext 35 | IMPORT ulICCIAR 36 | IMPORT ulICCEOIR 37 | 38 | EXPORT FreeRTOS_SWI_Handler 39 | EXPORT FreeRTOS_IRQ_Handler 40 | EXPORT vPortRestoreTaskContext 41 | 42 | ARM 43 | AREA PORT_ASM, CODE, READONLY 44 | 45 | 46 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 47 | ; SVC handler is used to yield a task. 48 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 49 | FreeRTOS_SWI_Handler 50 | 51 | PRESERVE8 52 | 53 | ; Save the context of the current task and select a new task to run. 54 | portSAVE_CONTEXT 55 | LDR R0, =vTaskSwitchContext 56 | BLX R0 57 | portRESTORE_CONTEXT 58 | 59 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 60 | ; vPortRestoreTaskContext is used to start the scheduler. 61 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 62 | vPortRestoreTaskContext 63 | ; Switch to system mode 64 | CPS #SYS_MODE 65 | portRESTORE_CONTEXT 66 | 67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 68 | ; PL390 GIC interrupt handler 69 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 70 | FreeRTOS_IRQ_Handler 71 | 72 | ; Return to the interrupted instruction. 73 | SUB lr, lr, #4 74 | 75 | ; Push the return address and SPSR 76 | PUSH {lr} 77 | MRS lr, SPSR 78 | PUSH {lr} 79 | 80 | ; Change to supervisor mode to allow reentry. 81 | CPS #SVC_MODE 82 | 83 | ; Push used registers. 84 | PUSH {r0-r4, r12} 85 | 86 | ; Increment nesting count. r3 holds the address of ulPortInterruptNesting 87 | ; for future use. r1 holds the original ulPortInterruptNesting value for 88 | ; future use. 89 | LDR r3, =ulPortInterruptNesting 90 | LDR r1, [r3] 91 | ADD r4, r1, #1 92 | STR r4, [r3] 93 | 94 | ; Read value from the interrupt acknowledge register, which is stored in r0 95 | ; for future parameter and interrupt clearing use. 96 | LDR r2, =ulICCIAR 97 | LDR r0, [r2] 98 | 99 | ; Ensure bit 2 of the stack pointer is clear. r2 holds the bit 2 value for 100 | ; future use. _RB_ Does this ever actually need to be done provided the 101 | ; start of the stack is 8-byte aligned? 102 | MOV r2, sp 103 | AND r2, r2, #4 104 | SUB sp, sp, r2 105 | 106 | ; Call the interrupt handler. r4 is pushed to maintain alignment. 107 | PUSH {r0-r4, lr} 108 | LDR r1, =vApplicationIRQHandler 109 | BLX r1 110 | POP {r0-r4, lr} 111 | ADD sp, sp, r2 112 | 113 | CPSID i 114 | 115 | ; Write the value read from ICCIAR to ICCEOIR 116 | LDR r4, =ulICCEOIR 117 | STR r0, [r4] 118 | 119 | ; Restore the old nesting count 120 | STR r1, [r3] 121 | 122 | ; A context switch is never performed if the nesting count is not 0 123 | CMP r1, #0 124 | BNE exit_without_switch 125 | 126 | ; Did the interrupt request a context switch? r1 holds the address of 127 | ; ulPortYieldRequired and r0 the value of ulPortYieldRequired for future 128 | ; use. 129 | LDR r1, =ulPortYieldRequired 130 | LDR r0, [r1] 131 | CMP r0, #0 132 | BNE switch_before_exit 133 | 134 | exit_without_switch 135 | ; No context switch. Restore used registers, LR_irq and SPSR before 136 | ; returning. 137 | POP {r0-r4, r12} 138 | CPS #IRQ_MODE 139 | POP {LR} 140 | MSR SPSR_cxsf, LR 141 | POP {LR} 142 | MOVS PC, LR 143 | 144 | switch_before_exit 145 | ; A context swtich is to be performed. Clear the context switch pending 146 | ; flag. 147 | MOV r0, #0 148 | STR r0, [r1] 149 | 150 | ; Restore used registers, LR-irq and SPSR before saving the context 151 | ; to the task stack. 152 | POP {r0-r4, r12} 153 | CPS #IRQ_MODE 154 | POP {LR} 155 | MSR SPSR_cxsf, LR 156 | POP {LR} 157 | portSAVE_CONTEXT 158 | 159 | ; Call the function that selects the new task to execute. 160 | ; vTaskSwitchContext() if vTaskSwitchContext() uses LDRD or STRD 161 | ; instructions, or 8 byte aligned stack allocated data. LR does not need 162 | ; saving as a new LR will be loaded by portRESTORE_CONTEXT anyway. 163 | LDR r0, =vTaskSwitchContext 164 | BLX r0 165 | 166 | ; Restore the context of, and branch to, the task selected to execute next. 167 | portRESTORE_CONTEXT 168 | 169 | 170 | END 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM_CA9/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef PORTMACRO_H 29 | #define PORTMACRO_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /*----------------------------------------------------------- 36 | * Port specific definitions. 37 | * 38 | * The settings in this file configure FreeRTOS correctly for the given hardware 39 | * and compiler. 40 | * 41 | * These settings should not be altered. 42 | *----------------------------------------------------------- 43 | */ 44 | 45 | /* Type definitions. */ 46 | #define portCHAR char 47 | #define portFLOAT float 48 | #define portDOUBLE double 49 | #define portLONG long 50 | #define portSHORT short 51 | #define portSTACK_TYPE uint32_t 52 | #define portBASE_TYPE long 53 | 54 | typedef portSTACK_TYPE StackType_t; 55 | typedef long BaseType_t; 56 | typedef unsigned long UBaseType_t; 57 | 58 | 59 | #if( configUSE_16_BIT_TICKS == 1 ) 60 | typedef uint16_t TickType_t; 61 | #define portMAX_DELAY ( TickType_t ) 0xffff 62 | #else 63 | typedef uint32_t TickType_t; 64 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 65 | 66 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do 67 | not need to be guarded with a critical section. */ 68 | #define portTICK_TYPE_IS_ATOMIC 1 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /* Hardware specifics. */ 73 | #define portSTACK_GROWTH ( -1 ) 74 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 75 | #define portBYTE_ALIGNMENT 8 76 | 77 | /*-----------------------------------------------------------*/ 78 | 79 | /* Task utilities. */ 80 | 81 | /* Called at the end of an ISR that can cause a context switch. */ 82 | #define portEND_SWITCHING_ISR( xSwitchRequired )\ 83 | { \ 84 | extern uint32_t ulPortYieldRequired; \ 85 | \ 86 | if( xSwitchRequired != pdFALSE ) \ 87 | { \ 88 | ulPortYieldRequired = pdTRUE; \ 89 | } \ 90 | } 91 | 92 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 93 | #define portYIELD() __asm( "SWI 0" ); 94 | 95 | 96 | /*----------------------------------------------------------- 97 | * Critical section control 98 | *----------------------------------------------------------*/ 99 | 100 | extern void vPortEnterCritical( void ); 101 | extern void vPortExitCritical( void ); 102 | extern uint32_t ulPortSetInterruptMask( void ); 103 | extern void vPortClearInterruptMask( uint32_t ulNewMaskValue ); 104 | 105 | /* These macros do not globally disable/enable interrupts. They do mask off 106 | interrupts that have a priority below configMAX_API_CALL_INTERRUPT_PRIORITY. */ 107 | #define portENTER_CRITICAL() vPortEnterCritical(); 108 | #define portEXIT_CRITICAL() vPortExitCritical(); 109 | #define portDISABLE_INTERRUPTS() ulPortSetInterruptMask() 110 | #define portENABLE_INTERRUPTS() vPortClearInterruptMask( 0 ) 111 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortSetInterruptMask() 112 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x) 113 | 114 | /*-----------------------------------------------------------*/ 115 | 116 | /* Task function macros as described on the FreeRTOS.org WEB site. These are 117 | not required for this port but included in case common demo code that uses these 118 | macros is used. */ 119 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 120 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 121 | 122 | /* Prototype of the FreeRTOS tick handler. This must be installed as the 123 | handler for whichever peripheral is used to generate the RTOS tick. */ 124 | void FreeRTOS_Tick_Handler( void ); 125 | 126 | /* Any task that uses the floating point unit MUST call vPortTaskUsesFPU() 127 | before any floating point instructions are executed. */ 128 | void vPortTaskUsesFPU( void ); 129 | #define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU() 130 | 131 | #define portLOWEST_INTERRUPT_PRIORITY ( ( ( uint32_t ) configUNIQUE_INTERRUPT_PRIORITIES ) - 1UL ) 132 | #define portLOWEST_USABLE_INTERRUPT_PRIORITY ( portLOWEST_INTERRUPT_PRIORITY - 1UL ) 133 | 134 | /* Architecture specific optimisations. */ 135 | #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 136 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 137 | #endif 138 | 139 | #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 140 | 141 | /* Store/clear the ready priorities in a bit map. */ 142 | #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) 143 | #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) 144 | 145 | /*-----------------------------------------------------------*/ 146 | 147 | #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __clz( uxReadyPriorities ) ) 148 | 149 | #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */ 150 | 151 | #ifdef configASSERT 152 | void vPortValidateInterruptPriority( void ); 153 | #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() 154 | #endif 155 | 156 | #define portNOP() __nop() 157 | 158 | #ifdef __cplusplus 159 | } 160 | #endif 161 | 162 | #endif /* PORTMACRO_H */ 163 | 164 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM_CA9/portmacro.inc: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V10.2.1 3 | ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | ; * this software and associated documentation files (the "Software"), to deal in 7 | ; * the Software without restriction, including without limitation the rights to 8 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 10 | ; * subject to the following conditions: 11 | ; * 12 | ; * The above copyright notice and this permission notice shall be included in all 13 | ; * copies or substantial portions of the Software. 14 | ; * 15 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | ; * 22 | ; * http://www.FreeRTOS.org 23 | ; * http://aws.amazon.com/freertos 24 | ; * 25 | ; * 1 tab == 4 spaces! 26 | ; */ 27 | 28 | SYS_MODE EQU 0x1f 29 | SVC_MODE EQU 0x13 30 | IRQ_MODE EQU 0x12 31 | 32 | IMPORT ulCriticalNesting 33 | IMPORT pxCurrentTCB 34 | IMPORT ulPortTaskHasFPUContext 35 | IMPORT ulAsmAPIPriorityMask 36 | IMPORT ulICCPMR 37 | 38 | 39 | MACRO 40 | portSAVE_CONTEXT 41 | 42 | ; Save the LR and SPSR onto the system mode stack before switching to 43 | ; system mode to save the remaining system mode registers 44 | SRSDB sp!, #SYS_MODE 45 | CPS #SYS_MODE 46 | PUSH {R0-R12, R14} 47 | 48 | ; Push the critical nesting count 49 | LDR R2, =ulCriticalNesting 50 | LDR R1, [R2] 51 | PUSH {R1} 52 | 53 | ; Does the task have a floating point context that needs saving? If 54 | ; ulPortTaskHasFPUContext is 0 then no. 55 | LDR R2, =ulPortTaskHasFPUContext 56 | LDR R3, [R2] 57 | CMP R3, #0 58 | 59 | ; Save the floating point context, if any 60 | FMRXNE R1, FPSCR 61 | VPUSHNE {D0-D15} 62 | VPUSHNE {D16-D31} 63 | PUSHNE {R1} 64 | 65 | ; Save ulPortTaskHasFPUContext itself 66 | PUSH {R3} 67 | 68 | ; Save the stack pointer in the TCB 69 | LDR R0, =pxCurrentTCB 70 | LDR R1, [R0] 71 | STR SP, [R1] 72 | 73 | MEND 74 | 75 | ; /**********************************************************************/ 76 | 77 | MACRO 78 | portRESTORE_CONTEXT 79 | 80 | ; Set the SP to point to the stack of the task being restored. 81 | LDR R0, =pxCurrentTCB 82 | LDR R1, [R0] 83 | LDR SP, [R1] 84 | 85 | ; Is there a floating point context to restore? If the restored 86 | ; ulPortTaskHasFPUContext is zero then no. 87 | LDR R0, =ulPortTaskHasFPUContext 88 | POP {R1} 89 | STR R1, [R0] 90 | CMP R1, #0 91 | 92 | ; Restore the floating point context, if any 93 | POPNE {R0} 94 | VPOPNE {D16-D31} 95 | VPOPNE {D0-D15} 96 | VMSRNE FPSCR, R0 97 | 98 | ; Restore the critical section nesting depth 99 | LDR R0, =ulCriticalNesting 100 | POP {R1} 101 | STR R1, [R0] 102 | 103 | ; Ensure the priority mask is correct for the critical nesting depth 104 | LDR R2, =ulICCPMR 105 | CMP R1, #0 106 | MOVEQ R4, #255 107 | LDRNE R4, =ulAsmAPIPriorityMask 108 | STR R4, [r2] 109 | 110 | ; Restore all system mode registers other than the SP (which is already 111 | ; being used) 112 | POP {R0-R12, R14} 113 | 114 | ; Return to the task code, loading CPSR on the way. 115 | RFEIA sp! 116 | 117 | MEND 118 | 119 | END 120 | 121 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM_CM0/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /*----------------------------------------------------------- 37 | * Port specific definitions. 38 | * 39 | * The settings in this file configure FreeRTOS correctly for the 40 | * given hardware and compiler. 41 | * 42 | * These settings should not be altered. 43 | *----------------------------------------------------------- 44 | */ 45 | 46 | /* Type definitions. */ 47 | #define portCHAR char 48 | #define portFLOAT float 49 | #define portDOUBLE double 50 | #define portLONG long 51 | #define portSHORT short 52 | #define portSTACK_TYPE uint32_t 53 | #define portBASE_TYPE long 54 | 55 | typedef portSTACK_TYPE StackType_t; 56 | typedef long BaseType_t; 57 | typedef unsigned long UBaseType_t; 58 | 59 | #if( configUSE_16_BIT_TICKS == 1 ) 60 | typedef uint16_t TickType_t; 61 | #define portMAX_DELAY ( TickType_t ) 0xffff 62 | #else 63 | typedef uint32_t TickType_t; 64 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 65 | 66 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do 67 | not need to be guarded with a critical section. */ 68 | #define portTICK_TYPE_IS_ATOMIC 1 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /* Architecture specifics. */ 73 | #define portSTACK_GROWTH ( -1 ) 74 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 75 | #define portBYTE_ALIGNMENT 8 76 | /*-----------------------------------------------------------*/ 77 | 78 | 79 | /* Scheduler utilities. */ 80 | extern void vPortYield( void ); 81 | #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 82 | #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 83 | #define portYIELD() vPortYield() 84 | #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT 85 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 86 | /*-----------------------------------------------------------*/ 87 | 88 | /* Critical section management. */ 89 | extern void vPortEnterCritical( void ); 90 | extern void vPortExitCritical( void ); 91 | extern uint32_t ulSetInterruptMaskFromISR( void ); 92 | extern void vClearInterruptMaskFromISR( uint32_t ulMask ); 93 | 94 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulSetInterruptMaskFromISR() 95 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vClearInterruptMaskFromISR( x ) 96 | #define portDISABLE_INTERRUPTS() __disable_irq() 97 | #define portENABLE_INTERRUPTS() __enable_irq() 98 | #define portENTER_CRITICAL() vPortEnterCritical() 99 | #define portEXIT_CRITICAL() vPortExitCritical() 100 | 101 | /*-----------------------------------------------------------*/ 102 | 103 | /* Task function macros as described on the FreeRTOS.org WEB site. */ 104 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 105 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 106 | 107 | #define portNOP() 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* PORTMACRO_H */ 114 | 115 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/RVDS/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/RVDS/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/RVDS/ARM_CM7/r0p1 18 | directory. -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the five sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler, where the directory name denotes the compiler 11 | specific files the directory contains. 12 | 13 | 14 | 15 | For example, if you are interested in the [compiler] port for the [architecture] 16 | microcontroller, then the port specific files are contained in 17 | FreeRTOS/Source/Portable/[compiler]/[architecture] directory. If this is the 18 | only port you are interested in then all the other directories can be 19 | ignored. 20 | 21 | -------------------------------------------------------------------------------- /2021舵轮步兵/FreeRTOS/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-BMI270/bmi.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-BMI270/bmi.h -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi270.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved. 3 | * 4 | * BSD-3-Clause 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | * @file bmi270.h 34 | * @date 2020-06-05 35 | * @version v2.53.2 36 | * 37 | */ 38 | 39 | /** 40 | * \ingroup bmi2xy 41 | * \defgroup bmi270 BMI270 42 | * @brief Sensor driver for BMI270 sensor 43 | */ 44 | 45 | #ifndef BMI270_H_ 46 | #define BMI270_H_ 47 | 48 | /*! CPP guard */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /***************************************************************************/ 54 | 55 | /*! Header files 56 | ****************************************************************************/ 57 | #include "bmi2.h" 58 | 59 | /***************************************************************************/ 60 | 61 | /*! Macro definitions 62 | ****************************************************************************/ 63 | 64 | /*! @name BMI270 Chip identifier */ 65 | #define BMI270_CHIP_ID UINT8_C(0x24) 66 | 67 | /*! @name BMI270 feature input start addresses */ 68 | #define BMI270_MAX_BURST_LEN_STRT_ADDR UINT8_C(0x02) 69 | #define BMI270_CRT_GYRO_SELF_TEST_STRT_ADDR UINT8_C(0x03) 70 | #define BMI270_ABORT_STRT_ADDR UINT8_C(0x03) 71 | #define BMI270_AXIS_MAP_STRT_ADDR UINT8_C(0x04) 72 | #define BMI270_GYRO_SELF_OFF_STRT_ADDR UINT8_C(0x05) 73 | #define BMI270_NVM_PROG_PREP_STRT_ADDR UINT8_C(0x05) 74 | #define BMI270_GYRO_GAIN_UPDATE_STRT_ADDR UINT8_C(0x06) 75 | #define BMI270_ANY_MOT_STRT_ADDR UINT8_C(0x0C) 76 | #define BMI270_NO_MOT_STRT_ADDR UINT8_C(0x00) 77 | #define BMI270_SIG_MOT_STRT_ADDR UINT8_C(0x04) 78 | #define BMI270_STEP_CNT_1_STRT_ADDR UINT8_C(0x00) 79 | #define BMI270_STEP_CNT_4_STRT_ADDR UINT8_C(0x02) 80 | #define BMI270_WRIST_GEST_STRT_ADDR UINT8_C(0x06) 81 | #define BMI270_WRIST_WEAR_WAKE_UP_STRT_ADDR UINT8_C(0x00) 82 | 83 | /*! @name BMI270 feature output start addresses */ 84 | #define BMI270_STEP_CNT_OUT_STRT_ADDR UINT8_C(0x00) 85 | #define BMI270_STEP_ACT_OUT_STRT_ADDR UINT8_C(0x04) 86 | #define BMI270_WRIST_GEST_OUT_STRT_ADDR UINT8_C(0x06) 87 | #define BMI270_GYR_USER_GAIN_OUT_STRT_ADDR UINT8_C(0x08) 88 | #define BMI270_GYRO_CROSS_SENSE_STRT_ADDR UINT8_C(0x0C) 89 | #define BMI270_NVM_VFRM_OUT_STRT_ADDR UINT8_C(0x0E) 90 | 91 | /*! @name Defines maximum number of pages */ 92 | #define BMI270_MAX_PAGE_NUM UINT8_C(8) 93 | 94 | /*! @name Defines maximum number of feature input configurations */ 95 | #define BMI270_MAX_FEAT_IN UINT8_C(16) 96 | 97 | /*! @name Defines maximum number of feature outputs */ 98 | #define BMI270_MAX_FEAT_OUT UINT8_C(7) 99 | 100 | /*! @name Mask definitions for feature interrupt status bits */ 101 | #define BMI270_SIG_MOT_STATUS_MASK UINT8_C(0x01) 102 | #define BMI270_STEP_CNT_STATUS_MASK UINT8_C(0x02) 103 | #define BMI270_STEP_ACT_STATUS_MASK UINT8_C(0x04) 104 | #define BMI270_WRIST_WAKE_UP_STATUS_MASK UINT8_C(0x08) 105 | #define BMI270_WRIST_GEST_STATUS_MASK UINT8_C(0x10) 106 | #define BMI270_NO_MOT_STATUS_MASK UINT8_C(0x20) 107 | #define BMI270_ANY_MOT_STATUS_MASK UINT8_C(0x40) 108 | 109 | /***************************************************************************/ 110 | 111 | /*! BMI270 User Interface function prototypes 112 | ****************************************************************************/ 113 | 114 | /** 115 | * \ingroup bmi270 116 | * \defgroup bmi270ApiInit Initialization 117 | * @brief Initialize the sensor and device structure 118 | */ 119 | 120 | /*! 121 | * \ingroup bmi270ApiInit 122 | * \page bmi270_api_bmi270_init bmi270_init 123 | * \code 124 | * int8_t bmi270_init(struct bmi2_dev *dev); 125 | * \endcode 126 | * @details This API: 127 | * 1) updates the device structure with address of the configuration file. 128 | * 2) Initializes BMI270 sensor. 129 | * 3) Writes the configuration file. 130 | * 4) Updates the feature offset parameters in the device structure. 131 | * 5) Updates the maximum number of pages, in the device structure. 132 | * 133 | * @param[in, out] dev : Structure instance of bmi2_dev. 134 | * 135 | * @return Result of API execution status 136 | * 137 | * @retval BMI2_OK - Success 138 | * @retval BMI2_E_NULL_PTR - Error: Null pointer error 139 | * @retval BMI2_E_COM_FAIL - Error: Communication fail 140 | * @retval BMI2_E_DEV_NOT_FOUND - Invalid device 141 | */ 142 | int8_t bmi270_init(struct bmi2_dev *dev); 143 | 144 | /******************************************************************************/ 145 | /*! @name C++ Guard Macros */ 146 | /******************************************************************************/ 147 | #ifdef __cplusplus 148 | } 149 | #endif /* End of CPP guard */ 150 | 151 | #endif /* BMI270_H_ */ 152 | -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi270_context.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved. 3 | * 4 | * BSD-3-Clause 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * 3. Neither the name of the copyright holder nor the names of its 17 | * contributors may be used to endorse or promote products derived from 18 | * this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 24 | * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | * POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | * @file bmi270_context.h 34 | * @date 2020-06-05 35 | * @version v2.53.2 36 | * 37 | */ 38 | 39 | /** 40 | * \ingroup bmi2xy 41 | * \defgroup bmi270_context BMI270_CONTEXT 42 | * @brief Sensor driver for BMI270_CONTEXT sensor 43 | */ 44 | 45 | #ifndef BMI270_CONTEXT_H_ 46 | #define BMI270_CONTEXT_H_ 47 | 48 | /*! CPP guard */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /***************************************************************************/ 54 | 55 | /*! Header files 56 | ****************************************************************************/ 57 | #include "bmi2.h" 58 | 59 | /***************************************************************************/ 60 | 61 | /*! Macro definitions 62 | ****************************************************************************/ 63 | 64 | /*! @name BMI270_CONTEXT Chip identifier */ 65 | #define BMI270_CONTEXT_CHIP_ID UINT8_C(0x24) 66 | 67 | /*! @name BMI270_CONTEXT feature input start addresses */ 68 | #define BMI270_CONTEXT_STEP_CNT_1_STRT_ADDR UINT8_C(0x00) 69 | #define BMI270_CONTEXT_STEP_CNT_4_STRT_ADDR UINT8_C(0x02) 70 | #define BMI270_CONTEXT_MAX_BURST_LEN_STRT_ADDR UINT8_C(0x08) 71 | #define BMI270_CONTEXT_CRT_GYRO_SELF_TEST_STRT_ADDR UINT8_C(0x09) 72 | #define BMI270_CONTEXT_ABORT_STRT_ADDR UINT8_C(0x09) 73 | #define BMI270_CONTEXT_NVM_PROG_PREP_STRT_ADDR UINT8_C(0x0A) 74 | #define BMI270_CONTEXT_ACT_RGN_SETT_STRT_ADDR UINT8_C(0x00) 75 | #define BMI270_CONTEXT_ACT_RGN_STRT_ADDR UINT8_C(0x0A) 76 | 77 | /*! @name BMI270_CONTEXT feature output start addresses */ 78 | #define BMI270_CONTEXT_STEP_CNT_OUT_STRT_ADDR UINT8_C(0x00) 79 | #define BMI270_CONTEXT_GYR_USER_GAIN_OUT_STRT_ADDR UINT8_C(0x04) 80 | #define BMI270_CONTEXT_GYRO_CROSS_SENSE_STRT_ADDR UINT8_C(0x0C) 81 | #define BMI270_CONTEXT_NVM_VFRM_OUT_STRT_ADDR UINT8_C(0x0E) 82 | 83 | /*! @name Defines maximum number of pages */ 84 | #define BMI270_CONTEXT_MAX_PAGE_NUM UINT8_C(8) 85 | 86 | /*! @name Defines maximum number of feature input configurations */ 87 | #define BMI270_CONTEXT_MAX_FEAT_IN UINT8_C(9) 88 | 89 | /*! @name Defines maximum number of feature outputs */ 90 | #define BMI270_CONTEXT_MAX_FEAT_OUT UINT8_C(5) 91 | 92 | /*! @name Mask definitions for feature interrupt status bits */ 93 | #define BMI270_CONTEXT_STEP_CNT_STATUS_MASK UINT8_C(0x01) 94 | 95 | /***************************************************************************/ 96 | 97 | /*! BMI270_CONTEXT User Interface function prototypes 98 | ****************************************************************************/ 99 | 100 | /** 101 | * \ingroup bmi270_context 102 | * \defgroup bmi270_contextApiInit Initialization 103 | * @brief Initialize the sensor and device structure 104 | */ 105 | 106 | /*! 107 | * \ingroup bmi270_contextApiInit 108 | * \page bmi270_context_api_bmi270_context_init bmi270_context_init 109 | * \code 110 | * int8_t bmi270_context_init(struct bmi2_dev *dev); 111 | * \endcode 112 | * @details This API: 113 | * 1) updates the device structure with address of the configuration file. 114 | * 2) Initializes BMI270_CONTEXT sensor. 115 | * 3) Writes the configuration file. 116 | * 4) Updates the feature offset parameters in the device structure. 117 | * 5) Updates the maximum number of pages, in the device structure. 118 | * 119 | * @param[in, out] dev : Structure instance of bmi2_dev. 120 | * 121 | * @return Result of API execution status 122 | * 123 | * @retval BMI2_OK - Success 124 | * @retval BMI2_E_NULL_PTR - Error: Null pointer error 125 | * @retval BMI2_E_COM_FAIL - Error: Communication fail 126 | * @retval BMI2_E_DEV_NOT_FOUND - Invalid device 127 | */ 128 | int8_t bmi270_context_init(struct bmi2_dev *dev); 129 | 130 | /******************************************************************************/ 131 | /*! @name C++ Guard Macros */ 132 | /******************************************************************************/ 133 | #ifdef __cplusplus 134 | } 135 | #endif /* End of CPP guard */ 136 | 137 | #endif /* BMI270_CONTEXT_H_ */ 138 | -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi2_common.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-BMI270/bmi2_common.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-BMI270/bmi2_common.h: -------------------------------------------------------------------------------- 1 | /**\ 2 | * Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | **/ 6 | 7 | #ifndef __BMI2_COMMON_H__ 8 | #define __BMI2_COMMON_H__ 9 | 10 | /*! CPP guard */ 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include 16 | #include "bmi2.h" 17 | 18 | void MPU_Read_all(uint8_t reg,uint8_t *buff,uint8_t len); 19 | uint8_t MPU_Read_Byte(uint8_t reg); 20 | uint8_t MPU_Write_Byte(uint8_t reg,uint8_t data) ; 21 | /*! 22 | * @brief Function for initialization of I2C bus 23 | * 24 | * @retval 0 -> Success 25 | * @retval < 0 -> Failure Info 26 | */ 27 | int8_t bmi2_user_i2c_init(void); 28 | 29 | /*! 30 | * @brief Function for initialization of SPI bus 31 | * 32 | * @retval 0 -> Success 33 | * @retval < 0 -> Failure Info 34 | */ 35 | int8_t bmi2_user_spi_init(void); 36 | 37 | /*! 38 | * @brief This function provides the delay for required time (Microseconds) as per the input provided in some of the 39 | * APIs. 40 | * @param[in] period_us : The required wait time in microseconds. 41 | * @param[in] intf_ptr : Pointer to interface. 42 | * @return void. 43 | * 44 | */ 45 | void user_delay_us(uint32_t period_us, void *intf_ptr); 46 | 47 | /*! 48 | * @brief This function provides the delay for required time (Milliseconds) as per the input provided in some of the 49 | * APIs. 50 | * @param[in] period_ms : The required wait time in milliseconds. 51 | * @return void. 52 | * 53 | */ 54 | void user_delay_ms(uint32_t period_ms); 55 | 56 | /*! 57 | * @brief This function is for reading the sensor's registers through I2C bus. 58 | * 59 | * @param[in] reg_addr : Register address. 60 | * @param[out] reg_data: Pointer to the data buffer to store the read data. 61 | * @param[in] length : No of bytes to read. 62 | * @param[in] intf_ptr : Pointer to interface. 63 | * 64 | * @return Status of execution 65 | * 66 | * @retval = BMI2_INTF_RET_SUCCESS -> Success 67 | * @retval != BMI2_INTF_RET_SUCCESS -> Failure 68 | * 69 | */ 70 | int8_t user_i2c_reg_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t length, void *intf_ptr); 71 | 72 | /*! 73 | * @brief This function is for writing the sensor's registers through I2C bus. 74 | * 75 | * @param[in] reg_addr : Register address. 76 | * @param[in] reg_data : Pointer to the data buffer whose value is to be written. 77 | * @param[in] length : No of bytes to write. 78 | * @param[in] intf_ptr : Pointer to interface. 79 | * 80 | * @return Status of execution 81 | * 82 | * @retval = BMI2_INTF_RET_SUCCESS -> Success 83 | * @retval != BMI2_INTF_RET_SUCCESS -> Failure 84 | * 85 | */ 86 | int8_t user_i2c_reg_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t length, void *intf_ptr); 87 | 88 | /*! 89 | * @brief This function is for reading the sensor's registers through SPI bus. 90 | * 91 | * @param[in] reg_addr : Register address. 92 | * @param[out] reg_data : Pointer to the data buffer to store the read data. 93 | * @param[in] length : No of bytes to read. 94 | * @param[in] intf_ptr : Pointer to interface. 95 | * 96 | * @return Status of execution 97 | * 98 | * @retval = BMI2_INTF_RET_SUCCESS -> Success 99 | * @retval != BMI2_INTF_RET_SUCCESS -> Failure 100 | * 101 | */ 102 | int8_t user_spi_reg_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t length, void *intf_ptr); 103 | 104 | /*! 105 | * @brief This function is for writing the sensor's registers through SPI bus. 106 | * 107 | * @param[in] reg_addr : Register address. 108 | * @param[in] reg_data : Pointer to the data buffer whose data has to be written. 109 | * @param[in] length : No of bytes to write. 110 | * @param[in] intf_ptr : Pointer to interface. 111 | * 112 | * @return Status of execution 113 | * 114 | * @retval = BMI2_INTF_RET_SUCCESS -> Success 115 | * @retval != BMI2_INTF_RET_SUCCESS -> Failure 116 | * 117 | */ 118 | int8_t user_spi_reg_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t length, void *intf_ptr); 119 | 120 | /*! 121 | * @brief This function is to select the interface between SPI and I2C. 122 | * 123 | * @param[in] dev : Structure instance of bmi2_dev 124 | * 125 | * @return Status of execution 126 | * @retval 0 -> Success 127 | * @retval < 0 -> Failure Info 128 | */ 129 | int8_t bmi2_interface_selection(struct bmi2_dev *dev); 130 | 131 | /*! 132 | * @brief This API is used to print the execution status. 133 | * 134 | * @param[in] rslt : Error code returned by the API whose execution status has to be printed. 135 | * 136 | * @return void. 137 | */ 138 | void bmi2_error_codes_print_result(int8_t rslt); 139 | 140 | #ifdef __cplusplus 141 | } 142 | #endif /* End of CPP guard */ 143 | 144 | #endif /* __BMI2_COMMON_H__ */ 145 | -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu.h -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu_dmp_motion_driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu_dmp_motion_driver.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/eMPL/inv_mpu_dmp_motion_driver.h: -------------------------------------------------------------------------------- 1 | /* 2 | $License: 3 | Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved. 4 | See included License.txt for License information. 5 | $ 6 | */ 7 | /** 8 | * @addtogroup DRIVERS Sensor Driver Layer 9 | * @brief Hardware drivers to communicate with sensors via I2C. 10 | * 11 | * @{ 12 | * @file inv_mpu_dmp_motion_driver.h 13 | * @brief DMP image and interface functions. 14 | * @details All functions are preceded by the dmp_ prefix to 15 | * differentiate among MPL and general driver function calls. 16 | */ 17 | #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ 18 | #define _INV_MPU_DMP_MOTION_DRIVER_H_ 19 | 20 | #include "system.h" 21 | 22 | #define TAP_X (0x01) 23 | #define TAP_Y (0x02) 24 | #define TAP_Z (0x04) 25 | #define TAP_XYZ (0x07) 26 | 27 | #define TAP_X_UP (0x01) 28 | #define TAP_X_DOWN (0x02) 29 | #define TAP_Y_UP (0x03) 30 | #define TAP_Y_DOWN (0x04) 31 | #define TAP_Z_UP (0x05) 32 | #define TAP_Z_DOWN (0x06) 33 | 34 | #define ANDROID_ORIENT_PORTRAIT (0x00) 35 | #define ANDROID_ORIENT_LANDSCAPE (0x01) 36 | #define ANDROID_ORIENT_REVERSE_PORTRAIT (0x02) 37 | #define ANDROID_ORIENT_REVERSE_LANDSCAPE (0x03) 38 | 39 | #define DMP_INT_GESTURE (0x01) 40 | #define DMP_INT_CONTINUOUS (0x02) 41 | 42 | #define DMP_FEATURE_TAP (0x001) 43 | #define DMP_FEATURE_ANDROID_ORIENT (0x002) 44 | #define DMP_FEATURE_LP_QUAT (0x004) 45 | #define DMP_FEATURE_PEDOMETER (0x008) 46 | #define DMP_FEATURE_6X_LP_QUAT (0x010) 47 | #define DMP_FEATURE_GYRO_CAL (0x020) 48 | #define DMP_FEATURE_SEND_RAW_ACCEL (0x040) 49 | #define DMP_FEATURE_SEND_RAW_GYRO (0x080) 50 | #define DMP_FEATURE_SEND_CAL_GYRO (0x100) 51 | 52 | #define INV_WXYZ_QUAT (0x100) 53 | 54 | /* Set up functions. */ 55 | int dmp_load_motion_driver_firmware(void); 56 | int dmp_set_fifo_rate(unsigned short rate); 57 | int dmp_get_fifo_rate(unsigned short *rate); 58 | int dmp_enable_feature(unsigned short mask); 59 | int dmp_get_enabled_features(unsigned short *mask); 60 | int dmp_set_interrupt_mode(unsigned char mode); 61 | int dmp_set_orientation(unsigned short orient); 62 | int dmp_set_gyro_bias(long *bias); 63 | int dmp_set_accel_bias(long *bias); 64 | 65 | /* Tap functions. */ 66 | int dmp_register_tap_cb(void (*func)(unsigned char, unsigned char)); 67 | int dmp_set_tap_thresh(unsigned char axis, unsigned short thresh); 68 | int dmp_set_tap_axes(unsigned char axis); 69 | int dmp_set_tap_count(unsigned char min_taps); 70 | int dmp_set_tap_time(unsigned short time); 71 | int dmp_set_tap_time_multi(unsigned short time); 72 | int dmp_set_shake_reject_thresh(long sf, unsigned short thresh); 73 | int dmp_set_shake_reject_time(unsigned short time); 74 | int dmp_set_shake_reject_timeout(unsigned short time); 75 | 76 | /* Android orientation functions. */ 77 | int dmp_register_android_orient_cb(void (*func)(unsigned char)); 78 | 79 | /* LP quaternion functions. */ 80 | int dmp_enable_lp_quat(unsigned char enable); 81 | int dmp_enable_6x_lp_quat(unsigned char enable); 82 | 83 | /* Pedometer functions. */ 84 | int dmp_get_pedometer_step_count(unsigned long *count); 85 | int dmp_set_pedometer_step_count(unsigned long count); 86 | int dmp_get_pedometer_walk_time(unsigned long *time); 87 | int dmp_set_pedometer_walk_time(unsigned long time); 88 | 89 | /* DMP gyro calibration functions. */ 90 | int dmp_enable_gyro_cal(unsigned char enable); 91 | 92 | /* Read function. This function should be called whenever the MPU interrupt is 93 | * detected. 94 | */ 95 | int dmp_read_fifo(short *gyro, short *accel, long *quat, 96 | unsigned long *timestamp, short *sensors, unsigned char *more); 97 | 98 | #endif /* #ifndef _INV_MPU_DMP_MOTION_DRIVER_H_ */ 99 | 100 | 101 | -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/iic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/iic.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/iic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/iic.h -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/mpu6050.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/mpu6050.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/mpu6050.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/mpu6050.h -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/myiic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/myiic.c -------------------------------------------------------------------------------- /2021舵轮步兵/IMU-mpu6050/myiic.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/IMU-mpu6050/myiic.h -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/Device/arm_mat_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_mat_init_f32.c 9 | * 10 | * Description: Floating-point matrix initialization. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixInit Matrix Initialization 49 | * 50 | * Initializes the underlying matrix data structure. 51 | * The functions set the numRows, 52 | * numCols, and pData fields 53 | * of the matrix data structure. 54 | */ 55 | 56 | /** 57 | * @addtogroup MatrixInit 58 | * @{ 59 | */ 60 | 61 | /** 62 | * @brief Floating-point matrix initialization. 63 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 64 | * @param[in] nRows number of rows in the matrix. 65 | * @param[in] nColumns number of columns in the matrix. 66 | * @param[in] *pData points to the matrix data array. 67 | * @return none 68 | */ 69 | 70 | void arm_mat_init_f32( 71 | arm_matrix_instance_f32 * S, 72 | uint16_t nRows, 73 | uint16_t nColumns, 74 | float32_t * pData) 75 | { 76 | /* Assign Number of Rows */ 77 | S->numRows = nRows; 78 | 79 | /* Assign Number of Columns */ 80 | S->numCols = nColumns; 81 | 82 | /* Assign Data pointer */ 83 | S->pData = pData; 84 | } 85 | 86 | /** 87 | * @} end of MatrixInit group 88 | */ 89 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/Device/arm_mat_scale_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_mat_scale_f32.c 9 | * 10 | * Description: Multiplies a floating-point matrix by a scalar. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixScale Matrix Scale 49 | * 50 | * Multiplies a matrix by a scalar. This is accomplished by multiplying each element in the 51 | * matrix by the scalar. For example: 52 | * \image html MatrixScale.gif "Matrix Scaling of a 3 x 3 matrix" 53 | * 54 | * The function checks to make sure that the input and output matrices are of the same size. 55 | * 56 | * In the fixed-point Q15 and Q31 functions, scale is represented by 57 | * a fractional multiplication scaleFract and an arithmetic shift shift. 58 | * The shift allows the gain of the scaling operation to exceed 1.0. 59 | * The overall scale factor applied to the fixed-point data is 60 | *
        
 61 |  *     scale = scaleFract * 2^shift.        
 62 |  * 
63 | */ 64 | 65 | /** 66 | * @addtogroup MatrixScale 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @brief Floating-point matrix scaling. 72 | * @param[in] *pSrc points to input matrix structure 73 | * @param[in] scale scale factor to be applied 74 | * @param[out] *pDst points to output matrix structure 75 | * @return The function returns either ARM_MATH_SIZE_MISMATCH 76 | * or ARM_MATH_SUCCESS based on the outcome of size checking. 77 | * 78 | */ 79 | 80 | arm_status arm_mat_scale_f32( 81 | const arm_matrix_instance_f32 * pSrc, 82 | float32_t scale, 83 | arm_matrix_instance_f32 * pDst) 84 | { 85 | float32_t *pIn = pSrc->pData; /* input data matrix pointer */ 86 | float32_t *pOut = pDst->pData; /* output data matrix pointer */ 87 | uint32_t numSamples; /* total number of elements in the matrix */ 88 | uint32_t blkCnt; /* loop counters */ 89 | arm_status status; /* status of matrix scaling */ 90 | 91 | #ifndef ARM_MATH_CM0_FAMILY 92 | 93 | float32_t in1, in2, in3, in4; /* temporary variables */ 94 | float32_t out1, out2, out3, out4; /* temporary variables */ 95 | 96 | #endif // #ifndef ARM_MATH_CM0_FAMILY 97 | 98 | #ifdef ARM_MATH_MATRIX_CHECK 99 | /* Check for matrix mismatch condition */ 100 | if((pSrc->numRows != pDst->numRows) || (pSrc->numCols != pDst->numCols)) 101 | { 102 | /* Set status as ARM_MATH_SIZE_MISMATCH */ 103 | status = ARM_MATH_SIZE_MISMATCH; 104 | } 105 | else 106 | #endif /* #ifdef ARM_MATH_MATRIX_CHECK */ 107 | { 108 | /* Total number of samples in the input matrix */ 109 | numSamples = (uint32_t) pSrc->numRows * pSrc->numCols; 110 | 111 | #ifndef ARM_MATH_CM0_FAMILY 112 | 113 | /* Run the below code for Cortex-M4 and Cortex-M3 */ 114 | 115 | /* Loop Unrolling */ 116 | blkCnt = numSamples >> 2; 117 | 118 | /* First part of the processing with loop unrolling. Compute 4 outputs at a time. 119 | ** a second loop below computes the remaining 1 to 3 samples. */ 120 | while(blkCnt > 0u) 121 | { 122 | /* C(m,n) = A(m,n) * scale */ 123 | /* Scaling and results are stored in the destination buffer. */ 124 | in1 = pIn[0]; 125 | in2 = pIn[1]; 126 | in3 = pIn[2]; 127 | in4 = pIn[3]; 128 | 129 | out1 = in1 * scale; 130 | out2 = in2 * scale; 131 | out3 = in3 * scale; 132 | out4 = in4 * scale; 133 | 134 | 135 | pOut[0] = out1; 136 | pOut[1] = out2; 137 | pOut[2] = out3; 138 | pOut[3] = out4; 139 | 140 | /* update pointers to process next sampels */ 141 | pIn += 4u; 142 | pOut += 4u; 143 | 144 | /* Decrement the numSamples loop counter */ 145 | blkCnt--; 146 | } 147 | 148 | /* If the numSamples is not a multiple of 4, compute any remaining output samples here. 149 | ** No loop unrolling is used. */ 150 | blkCnt = numSamples % 0x4u; 151 | 152 | #else 153 | 154 | /* Run the below code for Cortex-M0 */ 155 | 156 | /* Initialize blkCnt with number of samples */ 157 | blkCnt = numSamples; 158 | 159 | #endif /* #ifndef ARM_MATH_CM0_FAMILY */ 160 | 161 | while(blkCnt > 0u) 162 | { 163 | /* C(m,n) = A(m,n) * scale */ 164 | /* The results are stored in the destination buffer. */ 165 | *pOut++ = (*pIn++) * scale; 166 | 167 | /* Decrement the loop counter */ 168 | blkCnt--; 169 | } 170 | 171 | /* Set status as ARM_MATH_SUCCESS */ 172 | status = ARM_MATH_SUCCESS; 173 | } 174 | 175 | /* Return to application */ 176 | return (status); 177 | } 178 | 179 | /** 180 | * @} end of MatrixScale group 181 | */ 182 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/Include/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/Include/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/Include/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/Include/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Libraries/cmsis/stm32f4xx.h -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/cmsis/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /** @addtogroup CMSIS 29 | * @{ 30 | */ 31 | 32 | /** @addtogroup stm32f4xx_system 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Define to prevent recursive inclusion 38 | */ 39 | #ifndef __SYSTEM_STM32F4XX_H 40 | #define __SYSTEM_STM32F4XX_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** @addtogroup STM32F4xx_System_Includes 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @} 52 | */ 53 | 54 | 55 | /** @addtogroup STM32F4xx_System_Exported_types 56 | * @{ 57 | */ 58 | 59 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 60 | 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @addtogroup STM32F4xx_System_Exported_Constants 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @addtogroup STM32F4xx_System_Exported_Macros 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @addtogroup STM32F4xx_System_Exported_Functions 83 | * @{ 84 | */ 85 | 86 | extern void SystemInit(void); 87 | extern void SystemCoreClockUpdate(void); 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /*__SYSTEM_STM32F4XX_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/inc/stm32f4xx_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_crc.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2013 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_CRC_H 31 | #define __STM32F4xx_CRC_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup CRC 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup CRC_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /* Exported macro ------------------------------------------------------------*/ 60 | /* Exported functions --------------------------------------------------------*/ 61 | 62 | void CRC_ResetDR(void); 63 | uint32_t CRC_CalcCRC(uint32_t Data); 64 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 65 | uint32_t CRC_GetCRC(void); 66 | void CRC_SetIDRegister(uint8_t IDValue); 67 | uint8_t CRC_GetIDRegister(void); 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* __STM32F4xx_CRC_H */ 74 | 75 | /** 76 | * @} 77 | */ 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 84 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/inc/stm32f4xx_dbgmcu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_dbgmcu.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file contains all the functions prototypes for the DBGMCU firmware library. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __STM32F4xx_DBGMCU_H 30 | #define __STM32F4xx_DBGMCU_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "stm32f4xx.h" 38 | 39 | /** @addtogroup STM32F4xx_StdPeriph_Driver 40 | * @{ 41 | */ 42 | 43 | /** @addtogroup DBGMCU 44 | * @{ 45 | */ 46 | 47 | /* Exported types ------------------------------------------------------------*/ 48 | /* Exported constants --------------------------------------------------------*/ 49 | 50 | /** @defgroup DBGMCU_Exported_Constants 51 | * @{ 52 | */ 53 | #define DBGMCU_SLEEP ((uint32_t)0x00000001) 54 | #define DBGMCU_STOP ((uint32_t)0x00000002) 55 | #define DBGMCU_STANDBY ((uint32_t)0x00000004) 56 | #define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFF8) == 0x00) && ((PERIPH) != 0x00)) 57 | 58 | #define DBGMCU_TIM2_STOP ((uint32_t)0x00000001) 59 | #define DBGMCU_TIM3_STOP ((uint32_t)0x00000002) 60 | #define DBGMCU_TIM4_STOP ((uint32_t)0x00000004) 61 | #define DBGMCU_TIM5_STOP ((uint32_t)0x00000008) 62 | #define DBGMCU_TIM6_STOP ((uint32_t)0x00000010) 63 | #define DBGMCU_TIM7_STOP ((uint32_t)0x00000020) 64 | #define DBGMCU_TIM12_STOP ((uint32_t)0x00000040) 65 | #define DBGMCU_TIM13_STOP ((uint32_t)0x00000080) 66 | #define DBGMCU_TIM14_STOP ((uint32_t)0x00000100) 67 | #define DBGMCU_RTC_STOP ((uint32_t)0x00000400) 68 | #define DBGMCU_WWDG_STOP ((uint32_t)0x00000800) 69 | #define DBGMCU_IWDG_STOP ((uint32_t)0x00001000) 70 | #define DBGMCU_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000) 71 | #define DBGMCU_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000) 72 | #define DBGMCU_I2C3_SMBUS_TIMEOUT ((uint32_t)0x00800000) 73 | #define DBGMCU_CAN1_STOP ((uint32_t)0x02000000) 74 | #define DBGMCU_CAN2_STOP ((uint32_t)0x04000000) 75 | #define IS_DBGMCU_APB1PERIPH(PERIPH) ((((PERIPH) & 0xF91FE200) == 0x00) && ((PERIPH) != 0x00)) 76 | 77 | #define DBGMCU_TIM1_STOP ((uint32_t)0x00000001) 78 | #define DBGMCU_TIM8_STOP ((uint32_t)0x00000002) 79 | #define DBGMCU_TIM9_STOP ((uint32_t)0x00010000) 80 | #define DBGMCU_TIM10_STOP ((uint32_t)0x00020000) 81 | #define DBGMCU_TIM11_STOP ((uint32_t)0x00040000) 82 | #define IS_DBGMCU_APB2PERIPH(PERIPH) ((((PERIPH) & 0xFFF8FFFC) == 0x00) && ((PERIPH) != 0x00)) 83 | /** 84 | * @} 85 | */ 86 | 87 | /* Exported macro ------------------------------------------------------------*/ 88 | /* Exported functions --------------------------------------------------------*/ 89 | uint32_t DBGMCU_GetREVID(void); 90 | uint32_t DBGMCU_GetDEVID(void); 91 | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState); 92 | void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState); 93 | void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState); 94 | 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | 99 | #endif /* __STM32F4xx_DBGMCU_H */ 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 110 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/inc/stm32f4xx_iwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_iwdg.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file contains all the functions prototypes for the IWDG 8 | * firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2013 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_IWDG_H 31 | #define __STM32F4xx_IWDG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup IWDG 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup IWDG_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** @defgroup IWDG_WriteAccess 56 | * @{ 57 | */ 58 | #define IWDG_WriteAccess_Enable ((uint16_t)0x5555) 59 | #define IWDG_WriteAccess_Disable ((uint16_t)0x0000) 60 | #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ 61 | ((ACCESS) == IWDG_WriteAccess_Disable)) 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup IWDG_prescaler 67 | * @{ 68 | */ 69 | #define IWDG_Prescaler_4 ((uint8_t)0x00) 70 | #define IWDG_Prescaler_8 ((uint8_t)0x01) 71 | #define IWDG_Prescaler_16 ((uint8_t)0x02) 72 | #define IWDG_Prescaler_32 ((uint8_t)0x03) 73 | #define IWDG_Prescaler_64 ((uint8_t)0x04) 74 | #define IWDG_Prescaler_128 ((uint8_t)0x05) 75 | #define IWDG_Prescaler_256 ((uint8_t)0x06) 76 | #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ 77 | ((PRESCALER) == IWDG_Prescaler_8) || \ 78 | ((PRESCALER) == IWDG_Prescaler_16) || \ 79 | ((PRESCALER) == IWDG_Prescaler_32) || \ 80 | ((PRESCALER) == IWDG_Prescaler_64) || \ 81 | ((PRESCALER) == IWDG_Prescaler_128)|| \ 82 | ((PRESCALER) == IWDG_Prescaler_256)) 83 | /** 84 | * @} 85 | */ 86 | 87 | /** @defgroup IWDG_Flag 88 | * @{ 89 | */ 90 | #define IWDG_FLAG_PVU ((uint16_t)0x0001) 91 | #define IWDG_FLAG_RVU ((uint16_t)0x0002) 92 | #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)) 93 | #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) 94 | /** 95 | * @} 96 | */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /* Exported macro ------------------------------------------------------------*/ 103 | /* Exported functions --------------------------------------------------------*/ 104 | 105 | /* Prescaler and Counter configuration functions ******************************/ 106 | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess); 107 | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler); 108 | void IWDG_SetReload(uint16_t Reload); 109 | void IWDG_ReloadCounter(void); 110 | 111 | /* IWDG activation function ***************************************************/ 112 | void IWDG_Enable(void); 113 | 114 | /* Flag management function ***************************************************/ 115 | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG); 116 | 117 | #ifdef __cplusplus 118 | } 119 | #endif 120 | 121 | #endif /* __STM32F4xx_IWDG_H */ 122 | 123 | /** 124 | * @} 125 | */ 126 | 127 | /** 128 | * @} 129 | */ 130 | 131 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 132 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/inc/stm32f4xx_rng.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_rng.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file contains all the functions prototypes for the Random 8 | * Number Generator(RNG) firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2013 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_RNG_H 31 | #define __STM32F4xx_RNG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup RNG 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup RNG_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** @defgroup RNG_flags_definition 56 | * @{ 57 | */ 58 | #define RNG_FLAG_DRDY ((uint8_t)0x0001) /*!< Data ready */ 59 | #define RNG_FLAG_CECS ((uint8_t)0x0002) /*!< Clock error current status */ 60 | #define RNG_FLAG_SECS ((uint8_t)0x0004) /*!< Seed error current status */ 61 | 62 | #define IS_RNG_GET_FLAG(RNG_FLAG) (((RNG_FLAG) == RNG_FLAG_DRDY) || \ 63 | ((RNG_FLAG) == RNG_FLAG_CECS) || \ 64 | ((RNG_FLAG) == RNG_FLAG_SECS)) 65 | #define IS_RNG_CLEAR_FLAG(RNG_FLAG) (((RNG_FLAG) == RNG_FLAG_CECS) || \ 66 | ((RNG_FLAG) == RNG_FLAG_SECS)) 67 | /** 68 | * @} 69 | */ 70 | 71 | /** @defgroup RNG_interrupts_definition 72 | * @{ 73 | */ 74 | #define RNG_IT_CEI ((uint8_t)0x20) /*!< Clock error interrupt */ 75 | #define RNG_IT_SEI ((uint8_t)0x40) /*!< Seed error interrupt */ 76 | 77 | #define IS_RNG_IT(IT) ((((IT) & (uint8_t)0x9F) == 0x00) && ((IT) != 0x00)) 78 | #define IS_RNG_GET_IT(RNG_IT) (((RNG_IT) == RNG_IT_CEI) || ((RNG_IT) == RNG_IT_SEI)) 79 | /** 80 | * @} 81 | */ 82 | 83 | /** 84 | * @} 85 | */ 86 | 87 | /* Exported macro ------------------------------------------------------------*/ 88 | /* Exported functions --------------------------------------------------------*/ 89 | 90 | /* Function used to set the RNG configuration to the default reset state *****/ 91 | void RNG_DeInit(void); 92 | 93 | /* Configuration function *****************************************************/ 94 | void RNG_Cmd(FunctionalState NewState); 95 | 96 | /* Get 32 bit Random number function ******************************************/ 97 | uint32_t RNG_GetRandomNumber(void); 98 | 99 | /* Interrupts and flags management functions **********************************/ 100 | void RNG_ITConfig(FunctionalState NewState); 101 | FlagStatus RNG_GetFlagStatus(uint8_t RNG_FLAG); 102 | void RNG_ClearFlag(uint8_t RNG_FLAG); 103 | ITStatus RNG_GetITStatus(uint8_t RNG_IT); 104 | void RNG_ClearITPendingBit(uint8_t RNG_IT); 105 | 106 | #ifdef __cplusplus 107 | } 108 | #endif 109 | 110 | #endif /*__STM32F4xx_RNG_H */ 111 | 112 | /** 113 | * @} 114 | */ 115 | 116 | /** 117 | * @} 118 | */ 119 | 120 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 121 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/inc/stm32f4xx_wwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_wwdg.h 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file contains all the functions prototypes for the WWDG firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2013 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_WWDG_H 31 | #define __STM32F4xx_WWDG_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup WWDG 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup WWDG_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** @defgroup WWDG_Prescaler 56 | * @{ 57 | */ 58 | 59 | #define WWDG_Prescaler_1 ((uint32_t)0x00000000) 60 | #define WWDG_Prescaler_2 ((uint32_t)0x00000080) 61 | #define WWDG_Prescaler_4 ((uint32_t)0x00000100) 62 | #define WWDG_Prescaler_8 ((uint32_t)0x00000180) 63 | #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \ 64 | ((PRESCALER) == WWDG_Prescaler_2) || \ 65 | ((PRESCALER) == WWDG_Prescaler_4) || \ 66 | ((PRESCALER) == WWDG_Prescaler_8)) 67 | #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F) 68 | #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F)) 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** 75 | * @} 76 | */ 77 | 78 | /* Exported macro ------------------------------------------------------------*/ 79 | /* Exported functions --------------------------------------------------------*/ 80 | 81 | /* Function used to set the WWDG configuration to the default reset state ****/ 82 | void WWDG_DeInit(void); 83 | 84 | /* Prescaler, Refresh window and Counter configuration functions **************/ 85 | void WWDG_SetPrescaler(uint32_t WWDG_Prescaler); 86 | void WWDG_SetWindowValue(uint8_t WindowValue); 87 | void WWDG_EnableIT(void); 88 | void WWDG_SetCounter(uint8_t Counter); 89 | 90 | /* WWDG activation function ***************************************************/ 91 | void WWDG_Enable(uint8_t Counter); 92 | 93 | /* Interrupts and flags management functions **********************************/ 94 | FlagStatus WWDG_GetFlagStatus(void); 95 | void WWDG_ClearFlag(void); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* __STM32F4xx_WWDG_H */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 112 | -------------------------------------------------------------------------------- /2021舵轮步兵/Libraries/src/stm32f4xx_crc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_crc.c 4 | * @author MCD Application Team 5 | * @version V1.3.0 6 | * @date 08-November-2013 7 | * @brief This file provides all the CRC firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32f4xx_crc.h" 30 | 31 | /** @addtogroup STM32F4xx_StdPeriph_Driver 32 | * @{ 33 | */ 34 | 35 | /** @defgroup CRC 36 | * @brief CRC driver modules 37 | * @{ 38 | */ 39 | 40 | /* Private typedef -----------------------------------------------------------*/ 41 | /* Private define ------------------------------------------------------------*/ 42 | /* Private macro -------------------------------------------------------------*/ 43 | /* Private variables ---------------------------------------------------------*/ 44 | /* Private function prototypes -----------------------------------------------*/ 45 | /* Private functions ---------------------------------------------------------*/ 46 | 47 | /** @defgroup CRC_Private_Functions 48 | * @{ 49 | */ 50 | 51 | /** 52 | * @brief Resets the CRC Data register (DR). 53 | * @param None 54 | * @retval None 55 | */ 56 | void CRC_ResetDR(void) 57 | { 58 | /* Reset CRC generator */ 59 | CRC->CR = CRC_CR_RESET; 60 | } 61 | 62 | /** 63 | * @brief Computes the 32-bit CRC of a given data word(32-bit). 64 | * @param Data: data word(32-bit) to compute its CRC 65 | * @retval 32-bit CRC 66 | */ 67 | uint32_t CRC_CalcCRC(uint32_t Data) 68 | { 69 | CRC->DR = Data; 70 | 71 | return (CRC->DR); 72 | } 73 | 74 | /** 75 | * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit). 76 | * @param pBuffer: pointer to the buffer containing the data to be computed 77 | * @param BufferLength: length of the buffer to be computed 78 | * @retval 32-bit CRC 79 | */ 80 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength) 81 | { 82 | uint32_t index = 0; 83 | 84 | for(index = 0; index < BufferLength; index++) 85 | { 86 | CRC->DR = pBuffer[index]; 87 | } 88 | return (CRC->DR); 89 | } 90 | 91 | /** 92 | * @brief Returns the current CRC value. 93 | * @param None 94 | * @retval 32-bit CRC 95 | */ 96 | uint32_t CRC_GetCRC(void) 97 | { 98 | return (CRC->DR); 99 | } 100 | 101 | /** 102 | * @brief Stores a 8-bit data in the Independent Data(ID) register. 103 | * @param IDValue: 8-bit value to be stored in the ID register 104 | * @retval None 105 | */ 106 | void CRC_SetIDRegister(uint8_t IDValue) 107 | { 108 | CRC->IDR = IDValue; 109 | } 110 | 111 | /** 112 | * @brief Returns the 8-bit data stored in the Independent Data(ID) register 113 | * @param None 114 | * @retval 8-bit value of the ID register 115 | */ 116 | uint8_t CRC_GetIDRegister(void) 117 | { 118 | return (CRC->IDR); 119 | } 120 | 121 | /** 122 | * @} 123 | */ 124 | 125 | /** 126 | * @} 127 | */ 128 | 129 | /** 130 | * @} 131 | */ 132 | 133 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 134 | -------------------------------------------------------------------------------- /2021舵轮步兵/Project/DebugConfig/Target_1_STM32F405RG.dbgconf: -------------------------------------------------------------------------------- 1 | // <<< Use Configuration Wizard in Context Menu >>> 2 | 3 | // Debug MCU Configuration 4 | // DBG_SLEEP Debug Sleep Mode 5 | // DBG_STOP Debug Stop Mode 6 | // DBG_STANDBY Debug Standby Mode 7 | // 8 | DbgMCU_CR = 0x00000007; 9 | 10 | // Debug MCU APB1 Freeze 11 | // DBG_TIM2_STOP Timer 2 Stopped when Core is halted 12 | // DBG_TIM3_STOP Timer 3 Stopped when Core is halted 13 | // DBG_TIM4_STOP Timer 4 Stopped when Core is halted 14 | // DBG_TIM5_STOP Timer 5 Stopped when Core is halted 15 | // DBG_TIM6_STOP Timer 6 Stopped when Core is halted 16 | // DBG_TIM7_STOP Timer 7 Stopped when Core is halted 17 | // DBG_TIM12_STOP Timer 12 Stopped when Core is halted 18 | // DBG_TIM13_STOP Timer 13 Stopped when Core is halted 19 | // DBG_TIM14_STOP Timer 14 Stopped when Core is halted 20 | // DBG_RTC_STOP RTC Stopped when Core is halted 21 | // DBG_WWDG_STOP Window Watchdog Stopped when Core is halted 22 | // DBG_IWDG_STOP Independent Watchdog Stopped when Core is halted 23 | // DBG_I2C1_SMBUS_TIMEOUT I2C1 SMBUS Timeout Mode Stopped when Core is halted 24 | // DBG_I2C2_SMBUS_TIMEOUT I2C2 SMBUS Timeout Mode Stopped when Core is halted 25 | // DBG_I2C3_SMBUS_TIMEOUT I2C3 SMBUS Timeout Mode Stopped when Core is halted 26 | // DBG_CAN1_STOP CAN1 Stopped when Core is halted 27 | // DBG_CAN2_STOP CAN2 Stopped when Core is halted 28 | // 29 | DbgMCU_APB1_Fz = 0x00000000; 30 | 31 | 32 | // Debug MCU APB2 Freeze 33 | // DBG_TIM1_STOP Timer 1 Stopped when Core is halted 34 | // DBG_TIM8_STOP Timer 8 Stopped when Core is halted 35 | // DBG_TIM9_STOP Timer 9 Stopped when Core is halted 36 | // DBG_TIM10_STOP Timer 10 Stopped when Core is halted 37 | // DBG_TIM11_STOP Timer 11 Stopped when Core is halted 38 | // 39 | DbgMCU_APB2_Fz = 0x00000000; 40 | 41 | // <<< end of configuration section >>> -------------------------------------------------------------------------------- /2021舵轮步兵/Project/DebugConfig/Target_1_STM32F405RGTx.dbgconf: -------------------------------------------------------------------------------- 1 | // <<< Use Configuration Wizard in Context Menu >>> 2 | 3 | // Debug MCU Configuration 4 | // DBG_SLEEP Debug Sleep Mode 5 | // DBG_STOP Debug Stop Mode 6 | // DBG_STANDBY Debug Standby Mode 7 | // 8 | DbgMCU_CR = 0x00000007; 9 | 10 | // Debug MCU APB1 Freeze 11 | // DBG_TIM2_STOP Timer 2 Stopped when Core is halted 12 | // DBG_TIM3_STOP Timer 3 Stopped when Core is halted 13 | // DBG_TIM4_STOP Timer 4 Stopped when Core is halted 14 | // DBG_TIM5_STOP Timer 5 Stopped when Core is halted 15 | // DBG_TIM6_STOP Timer 6 Stopped when Core is halted 16 | // DBG_TIM7_STOP Timer 7 Stopped when Core is halted 17 | // DBG_TIM12_STOP Timer 12 Stopped when Core is halted 18 | // DBG_TIM13_STOP Timer 13 Stopped when Core is halted 19 | // DBG_TIM14_STOP Timer 14 Stopped when Core is halted 20 | // DBG_RTC_STOP RTC Stopped when Core is halted 21 | // DBG_WWDG_STOP Window Watchdog Stopped when Core is halted 22 | // DBG_IWDG_STOP Independent Watchdog Stopped when Core is halted 23 | // DBG_I2C1_SMBUS_TIMEOUT I2C1 SMBUS Timeout Mode Stopped when Core is halted 24 | // DBG_I2C2_SMBUS_TIMEOUT I2C2 SMBUS Timeout Mode Stopped when Core is halted 25 | // DBG_I2C3_SMBUS_TIMEOUT I2C3 SMBUS Timeout Mode Stopped when Core is halted 26 | // DBG_CAN1_STOP CAN1 Stopped when Core is halted 27 | // DBG_CAN2_STOP CAN2 Stopped when Core is halted 28 | // 29 | DbgMCU_APB1_Fz = 0x00000000; 30 | 31 | 32 | // Debug MCU APB2 Freeze 33 | // DBG_TIM1_STOP Timer 1 Stopped when Core is halted 34 | // DBG_TIM8_STOP Timer 8 Stopped when Core is halted 35 | // DBG_TIM9_STOP Timer 9 Stopped when Core is halted 36 | // DBG_TIM10_STOP Timer 10 Stopped when Core is halted 37 | // DBG_TIM11_STOP Timer 11 Stopped when Core is halted 38 | // 39 | DbgMCU_APB2_Fz = 0x00000000; 40 | 41 | // <<< end of configuration section >>> -------------------------------------------------------------------------------- /2021舵轮步兵/Project/DebugConfig/Target_1_STM32F407VETx.dbgconf: -------------------------------------------------------------------------------- 1 | // <<< Use Configuration Wizard in Context Menu >>> 2 | 3 | // Debug MCU Configuration 4 | // DBG_SLEEP Debug Sleep Mode 5 | // DBG_STOP Debug Stop Mode 6 | // DBG_STANDBY Debug Standby Mode 7 | // 8 | DbgMCU_CR = 0x00000007; 9 | 10 | // Debug MCU APB1 Freeze 11 | // DBG_TIM2_STOP Timer 2 Stopped when Core is halted 12 | // DBG_TIM3_STOP Timer 3 Stopped when Core is halted 13 | // DBG_TIM4_STOP Timer 4 Stopped when Core is halted 14 | // DBG_TIM5_STOP Timer 5 Stopped when Core is halted 15 | // DBG_TIM6_STOP Timer 6 Stopped when Core is halted 16 | // DBG_TIM7_STOP Timer 7 Stopped when Core is halted 17 | // DBG_TIM12_STOP Timer 12 Stopped when Core is halted 18 | // DBG_TIM13_STOP Timer 13 Stopped when Core is halted 19 | // DBG_TIM14_STOP Timer 14 Stopped when Core is halted 20 | // DBG_RTC_STOP RTC Stopped when Core is halted 21 | // DBG_WWDG_STOP Window Watchdog Stopped when Core is halted 22 | // DBG_IWDG_STOP Independent Watchdog Stopped when Core is halted 23 | // DBG_I2C1_SMBUS_TIMEOUT I2C1 SMBUS Timeout Mode Stopped when Core is halted 24 | // DBG_I2C2_SMBUS_TIMEOUT I2C2 SMBUS Timeout Mode Stopped when Core is halted 25 | // DBG_I2C3_SMBUS_TIMEOUT I2C3 SMBUS Timeout Mode Stopped when Core is halted 26 | // DBG_CAN1_STOP CAN1 Stopped when Core is halted 27 | // DBG_CAN2_STOP CAN2 Stopped when Core is halted 28 | // 29 | DbgMCU_APB1_Fz = 0x00000000; 30 | 31 | 32 | // Debug MCU APB2 Freeze 33 | // DBG_TIM1_STOP Timer 1 Stopped when Core is halted 34 | // DBG_TIM8_STOP Timer 8 Stopped when Core is halted 35 | // DBG_TIM9_STOP Timer 9 Stopped when Core is halted 36 | // DBG_TIM10_STOP Timer 10 Stopped when Core is halted 37 | // DBG_TIM11_STOP Timer 11 Stopped when Core is halted 38 | // 39 | DbgMCU_APB2_Fz = 0x00000000; 40 | 41 | // <<< end of configuration section >>> -------------------------------------------------------------------------------- /2021舵轮步兵/Project/DebugConfig/Target_1_STM32F407VG.dbgconf: -------------------------------------------------------------------------------- 1 | // <<< Use Configuration Wizard in Context Menu >>> 2 | 3 | // Debug MCU Configuration 4 | // DBG_SLEEP Debug Sleep Mode 5 | // DBG_STOP Debug Stop Mode 6 | // DBG_STANDBY Debug Standby Mode 7 | // 8 | DbgMCU_CR = 0x00000007; 9 | 10 | // Debug MCU APB1 Freeze 11 | // DBG_TIM2_STOP Timer 2 Stopped when Core is halted 12 | // DBG_TIM3_STOP Timer 3 Stopped when Core is halted 13 | // DBG_TIM4_STOP Timer 4 Stopped when Core is halted 14 | // DBG_TIM5_STOP Timer 5 Stopped when Core is halted 15 | // DBG_TIM6_STOP Timer 6 Stopped when Core is halted 16 | // DBG_TIM7_STOP Timer 7 Stopped when Core is halted 17 | // DBG_TIM12_STOP Timer 12 Stopped when Core is halted 18 | // DBG_TIM13_STOP Timer 13 Stopped when Core is halted 19 | // DBG_TIM14_STOP Timer 14 Stopped when Core is halted 20 | // DBG_RTC_STOP RTC Stopped when Core is halted 21 | // DBG_WWDG_STOP Window Watchdog Stopped when Core is halted 22 | // DBG_IWDG_STOP Independent Watchdog Stopped when Core is halted 23 | // DBG_I2C1_SMBUS_TIMEOUT I2C1 SMBUS Timeout Mode Stopped when Core is halted 24 | // DBG_I2C2_SMBUS_TIMEOUT I2C2 SMBUS Timeout Mode Stopped when Core is halted 25 | // DBG_I2C3_SMBUS_TIMEOUT I2C3 SMBUS Timeout Mode Stopped when Core is halted 26 | // DBG_CAN1_STOP CAN1 Stopped when Core is halted 27 | // DBG_CAN2_STOP CAN2 Stopped when Core is halted 28 | // 29 | DbgMCU_APB1_Fz = 0x00000000; 30 | 31 | 32 | // Debug MCU APB2 Freeze 33 | // DBG_TIM1_STOP Timer 1 Stopped when Core is halted 34 | // DBG_TIM8_STOP Timer 8 Stopped when Core is halted 35 | // DBG_TIM9_STOP Timer 9 Stopped when Core is halted 36 | // DBG_TIM10_STOP Timer 10 Stopped when Core is halted 37 | // DBG_TIM11_STOP Timer 11 Stopped when Core is halted 38 | // 39 | DbgMCU_APB2_Fz = 0x00000000; 40 | 41 | // <<< end of configuration section >>> -------------------------------------------------------------------------------- /2021舵轮步兵/Project/EventRecorderStub.scvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /2021舵轮步兵/Project/JLinkLog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/JLinkLog.txt -------------------------------------------------------------------------------- /2021舵轮步兵/Project/JLinkSettings.ini: -------------------------------------------------------------------------------- 1 | [BREAKPOINTS] 2 | ForceImpTypeAny = 0 3 | ShowInfoWin = 1 4 | EnableFlashBP = 2 5 | BPDuringExecution = 0 6 | [CFI] 7 | CFISize = 0x00 8 | CFIAddr = 0x00 9 | [CPU] 10 | OverrideMemMap = 0 11 | AllowSimulation = 1 12 | ScriptFile="" 13 | [FLASH] 14 | CacheExcludeSize = 0x00 15 | CacheExcludeAddr = 0x00 16 | MinNumBytesFlashDL = 0 17 | SkipProgOnCRCMatch = 1 18 | VerifyDownload = 1 19 | AllowCaching = 1 20 | EnableFlashDL = 2 21 | Override = 1 22 | Device="Unspecified" 23 | [GENERAL] 24 | WorkRAMSize = 0x00 25 | WorkRAMAddr = 0x00 26 | RAMUsageLimit = 0x00 27 | [SWO] 28 | SWOLogFile="" 29 | [MEM] 30 | RdOverrideOrMask = 0x00 31 | RdOverrideAndMask = 0xFFFFFFFF 32 | RdOverrideAddr = 0xFFFFFFFF 33 | WrOverrideOrMask = 0x00 34 | WrOverrideAndMask = 0xFFFFFFFF 35 | WrOverrideAddr = 0xFFFFFFFF 36 | -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/ExtDll.iex: -------------------------------------------------------------------------------- 1 | [EXTDLL] 2 | Count=0 3 | -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_add_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_add_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_init_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_init_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_inverse_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_inverse_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_inverse_f64.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_inverse_f64.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_mult_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_mult_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_scale_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_scale_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_sub_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_sub_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/arm_mat_trans_f32.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/arm_mat_trans_f32.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/auto.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/auto.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi2.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi2.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi270.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi270.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi270_context.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi270_context.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi2_common.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi2_common.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/bmi2_ois.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/bmi2_ois.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/buff.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/buff.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/can1.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/can1.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/can2.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/can2.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/chassis.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/chassis.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/control.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/control.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/crc.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/crc.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/crc_1.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/crc_1.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/croutine.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/croutine.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/cusui.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/cusui.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/event_groups.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/event_groups.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/freertos_init.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/freertos_init.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/gimbal.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/gimbal.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/go.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/go.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/heap_4.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/heap_4.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/inv_mpu.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/inv_mpu.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/inv_mpu_dmp_motion_driver.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/inv_mpu_dmp_motion_driver.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/iwdg.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/iwdg.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/kalman.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/kalman.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/led.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/led.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/list.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/list.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/main.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/main.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/masters_rtx.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/masters_rtx.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/misc.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/misc.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/module.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/module.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/motor.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/motor.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/mpu6050.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/mpu6050.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/my_imu.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/my_imu.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/myiic.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/myiic.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/pid.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/pid.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/port.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/port.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/project.axf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/project.axf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/project.build_log.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/project.build_log.htm -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/project.lnp: -------------------------------------------------------------------------------- 1 | --cpu=Cortex-M4.fp.sp 2 | ".\objects\usart.o" 3 | ".\objects\sys.o" 4 | ".\objects\arm_mat_init_f32.o" 5 | ".\objects\arm_mat_trans_f32.o" 6 | ".\objects\arm_mat_sub_f32.o" 7 | ".\objects\arm_mat_scale_f32.o" 8 | ".\objects\arm_mat_mult_f32.o" 9 | ".\objects\arm_mat_inverse_f64.o" 10 | ".\objects\arm_mat_inverse_f32.o" 11 | ".\objects\arm_mat_add_f32.o" 12 | "..\Libraries\Device\arm_cortexM4lf_math.lib" 13 | ".\objects\startup_stm32f40xx.o" 14 | ".\objects\misc.o" 15 | ".\objects\stm32f4xx_syscfg.o" 16 | ".\objects\stm32f4xx_gpio.o" 17 | ".\objects\stm32f4xx_rcc.o" 18 | ".\objects\stm32f4xx_tim.o" 19 | ".\objects\stm32f4xx_usart.o" 20 | ".\objects\system_stm32f4xx.o" 21 | ".\objects\stm32f4xx_can.o" 22 | ".\objects\stm32f4xx_dma.o" 23 | ".\objects\stm32f4xx_exti.o" 24 | ".\objects\stm32f4xx_flash.o" 25 | ".\objects\stm32f4xx_spi.o" 26 | ".\objects\stm32f4xx_adc.o" 27 | ".\objects\stm32f4xx_iwdg.o" 28 | ".\objects\main.o" 29 | ".\objects\stm32f4xx_it.o" 30 | ".\objects\go.o" 31 | ".\objects\system.o" 32 | ".\objects\zigbee_upper.o" 33 | ".\objects\freertos_init.o" 34 | ".\objects\sonic.o" 35 | ".\objects\iwdg.o" 36 | ".\objects\can1.o" 37 | ".\objects\can2.o" 38 | ".\objects\led.o" 39 | ".\objects\tim.o" 40 | ".\objects\myiic.o" 41 | ".\objects\uart4.o" 42 | ".\objects\uart1.o" 43 | ".\objects\uart3.o" 44 | ".\objects\mpu6050.o" 45 | ".\objects\inv_mpu.o" 46 | ".\objects\inv_mpu_dmp_motion_driver.o" 47 | ".\objects\bmi.o" 48 | ".\objects\bmi2.o" 49 | ".\objects\bmi2_common.o" 50 | ".\objects\bmi2_ois.o" 51 | ".\objects\bmi270.o" 52 | ".\objects\bmi270_context.o" 53 | ".\objects\vision.o" 54 | ".\objects\buff.o" 55 | ".\objects\auto.o" 56 | ".\objects\sincostable.o" 57 | ".\objects\kalman.o" 58 | ".\objects\masters_rtx.o" 59 | ".\objects\cusui.o" 60 | ".\objects\crc.o" 61 | ".\objects\referee.o" 62 | ".\objects\system_state.o" 63 | ".\objects\gimbal.o" 64 | ".\objects\rudder.o" 65 | ".\objects\remote.o" 66 | ".\objects\chassis.o" 67 | ".\objects\module.o" 68 | ".\objects\rifle.o" 69 | ".\objects\motor.o" 70 | ".\objects\my_imu.o" 71 | ".\objects\pid.o" 72 | ".\objects\croutine.o" 73 | ".\objects\event_groups.o" 74 | ".\objects\list.o" 75 | ".\objects\queue.o" 76 | ".\objects\tasks.o" 77 | ".\objects\timers.o" 78 | ".\objects\heap_4.o" 79 | ".\objects\port.o" 80 | --strict --scatter ".\Objects\project.sct" 81 | --summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols 82 | --info sizes --info totals --info unused --info veneers 83 | --list ".\Listings\project.map" -o .\Objects\project.axf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/project.sct: -------------------------------------------------------------------------------- 1 | ; ************************************************************* 2 | ; *** Scatter-Loading Description File generated by uVision *** 3 | ; ************************************************************* 4 | 5 | LR_IROM1 0x08000000 0x00080000 { ; load region size_region 6 | ER_IROM1 0x08000000 0x00080000 { ; load address = execution address 7 | *.o (RESET, +First) 8 | *(InRoot$$Sections) 9 | .ANY (+RO) 10 | .ANY (+XO) 11 | } 12 | RW_IRAM1 0x20000000 0x00020000 { ; RW data 13 | .ANY (+RW +ZI) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/queue.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/queue.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/referee.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/referee.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/referee_1.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/referee_1.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/remote.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/remote.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/rifle.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/rifle.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/rudder.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/rudder.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/sincostable.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/sincostable.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/soft_iic.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/soft_iic.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/sonic.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/sonic.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_adc.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_adc.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_can.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_can.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_dma.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_dma.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_exti.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_exti.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_flash.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_flash.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_gpio.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_gpio.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_it.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_it.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_iwdg.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_iwdg.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_rcc.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_rcc.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_spi.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_spi.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_syscfg.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_syscfg.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_tim.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_tim.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/stm32f4xx_usart.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/stm32f4xx_usart.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/sys.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/sys.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/system.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/system.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/system_state.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/system_state.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/system_stm32f4xx.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/system_stm32f4xx.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/tasks.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/tasks.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/tim.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/tim.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/timers.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/timers.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/uart1.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/uart1.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/uart3.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/uart3.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/uart4.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/uart4.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/usart.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/usart.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/usart2.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/usart2.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/vision.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/vision.crf -------------------------------------------------------------------------------- /2021舵轮步兵/Project/Objects/zigbee_upper.crf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/Project/Objects/zigbee_upper.crf -------------------------------------------------------------------------------- /2021舵轮步兵/SYSTEM/sys.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/SYSTEM/sys.c -------------------------------------------------------------------------------- /2021舵轮步兵/SYSTEM/sys.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/SYSTEM/sys.h -------------------------------------------------------------------------------- /2021舵轮步兵/SYSTEM/usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/SYSTEM/usart.c -------------------------------------------------------------------------------- /2021舵轮步兵/SYSTEM/usart.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/SYSTEM/usart.h -------------------------------------------------------------------------------- /2021舵轮步兵/keilkilll.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/2021舵轮步兵/keilkilll.bat -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # RM步兵2 2 | 3 | #### Description 4 | RM2021赛季-深圳大学RobotPilots战队-舵轮步兵代码 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 双枪舵轮步兵 2 | 3 | #### 说明 4 | 5 | * 此代码为RM2021赛季深圳大学RobotPilots战队的舵轮步兵代码 6 | * 代码中包含了两种陀螺仪(BMI270和MPU6050)的驱动 7 | * 代码只包含一台舵轮步兵的控制参数和逻辑,不需要通过system.h中的Infantry宏定义控制步兵ID 8 | * 舵轮步兵包含云台、底盘、超电控制主控共计3主控,通过system.h中的Master宏定义控制主控ID(不包括超电控制主控代码) 9 | * **步兵操作思维导图、舵轮控制原理** 放在doc文件夹中 10 | 11 | **云台代码功能:** 12 | 13 | 接收遥控器控制命令,作为主机定义整车系统状态,监测整车信息标志位等等,控制云台Yaw、Pitch双轴运动,与视觉通信,控制打弹及热量限制,下发控制命令。 14 | 15 | **底盘代码功能:** 16 | 17 | 接收云台主控的系统状态信息,与裁判系统通信、负责UI绘制并上传裁判系统数据,并与超电控制主控通信、负责底盘功率限制和控制底盘4个驱动电机、负责控制舵电机朝向控制等任务。 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | # A 26 | 27 | ### 开发依赖工具:Keil 28 | 29 | ### 开发系统环境:windows10 30 | 31 | ### 开发硬件环境:STM32F407 32 | 33 | # B 34 | 35 | ### 编译方式:gcc 36 | 37 | ### 代码烧录:Jlink 38 | 39 | # C 40 | 41 | ### **文件目录结构、代码内容等说明:** 42 | 43 | ![代码目录](picture/代码目录.png) 44 | 45 | * **rudder.c文件为舵轮控制代码** 46 | 47 | * 系统驱动部分的代码主要为基础外设驱动、stm32底层驱动程序以及外设参数初始化程序 48 | 49 | * FUNCTION文件夹为视觉功能(自瞄、打符)的控制代码 50 | 51 | * 设备树DEVICE文件夹中的所有代码.c文件第一个函数均为任务执行函数,motor文件中为整车电机管理程序,my_imu文件中存放对于陀螺仪数据的处理程序 52 | 53 | * 任务调度表位于APP文件夹中的FreeRTOS_Init.c文件中 54 | 55 | ![头文件](picture/头文件.png) 56 | 57 | * 在“系统驱动”部分的代码中有包含了部分中间层软件库 58 | 59 | Driver.h中包含了简单的电机数据收发统一管理库和PID基本算法、模式辨别类 60 | 61 | GO.h中包含了RP机器人队伍统一的模式和整车逻辑管理类 62 | 63 | # D 64 | 65 | ### 程序架构 66 | 67 | ![软件框图](picture/软件框图.png) 68 | 69 | ### 通信数据流线路框图 70 | 71 | ![通信线路框图](picture/通信线路框图.png) 72 | 73 | ### 供电线路框图和裁判系统连接图 74 | 75 | ![供电框图和裁判系统](picture/供电框图和裁判系统.png) 76 | 77 | # E 重要代码原理介绍与理论支持分析 78 | 79 | ### 1、舵轮控制原理 80 | 81 | > ## ***具体详细的解算控制分析都在doc文件夹的文档中*** 82 | 83 | ### ![舵轮控制原理文件](picture/舵轮控制原理文件.png) 84 | 85 | 以左前轮的速度合成解算为示例,说明文档中有具体分析 86 | 87 | ![舵轮左前轮解算试例](picture/舵轮左前轮解算试例.jpg) 88 | 89 | 核心算法如图: 90 | 91 | ![舵轮Z轴合成算法](picture/舵轮Z轴合成算法.png) 92 | 93 | ### 2、双枪控制与枪管切换 94 | 95 | ​ 发射机构为单拨盘双枪管垂直摩擦轮电机结构,在切换枪管的控制上,在学校调试时卡弹的情况难以避免,故卡弹处理对于枪管的切换有很大帮助,**具体代码位于Rifle.c文件中**,包含拨盘卡弹处理以及双枪切换条件的设置,控制上设置了手动切换枪管和自动切换枪管,不可同时打弹。 96 | 97 | 98 | 99 | ### 3、系统控制命令捕捉 100 | 101 | ![系统控制命令捕捉](picture/系统控制命令捕捉.png) 102 | 103 | ​ 每个函数当中不存在轮询,执行速度较快,可以实时、同时(执行速度在1ms内)捕捉各个按键的反应值,系统采用状态检测后上报系统,再下发各个设备树任务响应状态的写法,在每个按键函数中能够清楚反映操作意图,以Z按键为例: 104 | 105 | ![Z按键为例](picture/Z按键为例.png)![按键状态枚举](picture/按键状态枚举.png) 106 | 107 | ​ 每个按键的5个状态在不同功能操作上发挥不同的作用,这使得后期采纳操作手反馈、商讨做出修改更加快捷、可观、有规划,并且能够保证代码整洁性和稳定性。 108 | 109 | ​ 同样,对于遥控器的控制也有类似的操作,**具体程序均位于Remote.c中**。 110 | 111 | 112 | 113 | # F 程序层级 114 | 115 | ![程序架构](picture/程序架构.png) 116 | 117 | 118 | 119 | 120 | 121 | # G 未来优化方向 122 | 123 | 1、舵轮底盘的加减速目前是一个变斜率的斜坡函数,目前能缓解一定程度的加减速带来的车身平衡影响和倾覆,但响应不能太快,加减速有一定延迟,需要采用更优的策略,由于紧迫的时间关系,比赛前没来得及调试。 124 | 125 | 2、CAN1作为上下主控的通信线路负担可能较大,但目前能够维持整车正常运行,是由于一开始规划不当所导致。CAN1和CAN2的任务分配上可进行优化。 126 | 127 | 3、双枪云台的4个摩擦轮电机本身存在弊端,Pwm电机在堵转时会出现重启重校准导致尿弹,未来摩擦轮电机选型会优化。 128 | 129 | 130 | 131 | 小小鸣谢 132 | 133 | 在此特别感谢深圳大学RobotPilots战队给予我这么一个共同努力热情满满的大家庭,不论是哪一个组别的伙伴们一年来都辛苦了,尤其是步兵组的全体成员!同时也感谢全国所有学校共同呈现如此精彩的技术交流,祝愿所有为了梦想而努力的机甲大师们未来一帆风顺,成为自己人生中的机甲大师! 134 | 135 | -------------------------------------------------------------------------------- /doc/步兵操作.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/doc/步兵操作.pdf -------------------------------------------------------------------------------- /doc/步兵操作.xmind: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/doc/步兵操作.xmind -------------------------------------------------------------------------------- /doc/舵轮控制原理.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/doc/舵轮控制原理.docx -------------------------------------------------------------------------------- /picture/PID算法.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/PID算法.png -------------------------------------------------------------------------------- /picture/PID算法图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/PID算法图.png -------------------------------------------------------------------------------- /picture/Z按键为例.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/Z按键为例.png -------------------------------------------------------------------------------- /picture/代码目录.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/代码目录.png -------------------------------------------------------------------------------- /picture/代码目录2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/代码目录2.png -------------------------------------------------------------------------------- /picture/供电框图和裁判系统.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/供电框图和裁判系统.png -------------------------------------------------------------------------------- /picture/头文件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/头文件.png -------------------------------------------------------------------------------- /picture/按键状态枚举.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/按键状态枚举.png -------------------------------------------------------------------------------- /picture/硬件框图--滑环.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/硬件框图--滑环.png -------------------------------------------------------------------------------- /picture/程序架构.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/程序架构.png -------------------------------------------------------------------------------- /picture/系统控制命令捕捉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/系统控制命令捕捉.png -------------------------------------------------------------------------------- /picture/舵轮Z轴合成算法.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/舵轮Z轴合成算法.png -------------------------------------------------------------------------------- /picture/舵轮左前轮解算试例.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/舵轮左前轮解算试例.jpg -------------------------------------------------------------------------------- /picture/舵轮控制原理文件.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/舵轮控制原理文件.png -------------------------------------------------------------------------------- /picture/软件框图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/软件框图.png -------------------------------------------------------------------------------- /picture/通信线路框图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lowBO/RP-Infantry-2/e68d1115537f7608e06de8c65178ce04fa7c5f42/picture/通信线路框图.png --------------------------------------------------------------------------------