Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shivam: Timers Wrapper Code Review #49

Closed
wants to merge 84 commits into from
Closed
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
4a3299b
Initial Implementation of Core Objects
cjchanx Jul 30, 2022
b81b769
Pull README.md changes from Chris/AndromedaC++
cjchanx Jul 30, 2022
e6a86c6
Attempt to Implement FlightTask
cjchanx Aug 6, 2022
5859a4a
Add VS2022 .gitignore
cjchanx Aug 6, 2022
f8e6031
Update Project Compilation and Refactoring
cjchanx Aug 9, 2022
8ebf752
Implement wrapper for RTOS Mutex
cjchanx Aug 13, 2022
67f7b7f
Implement wrapper for RTOS Mutex (#46)
cjchanx Aug 13, 2022
f8c99cd
Merge branch 'StudentOrganisationForAerospaceResearch:Chris/Ouroboros…
cjchanx Aug 13, 2022
a86f9b7
Start UARTTask
cjchanx Aug 15, 2022
d4fffcd
Merge branch 'Chris/OuroborosC++' of https://github.com/StudentOrgani…
cjchanx Aug 15, 2022
6f06ea6
Add clarification on _IDE README.md
cjchanx Aug 15, 2022
fd89a05
Begin Implementing RTOS Timer Wrapper
cjchanx Aug 18, 2022
cfe977b
Add UARTTask to VS2022
cjchanx Aug 18, 2022
f45eb7b
Start File for UARTTask
cjchanx Aug 18, 2022
13e820d
Add Notes
cjchanx Aug 18, 2022
5e851fd
Update README.md
cjchanx Aug 18, 2022
6ae14a0
Update README.md
cjchanx Aug 18, 2022
b983ffa
Begin implementation of UARTTask::Init
cjchanx Aug 20, 2022
08b1593
Merge branch 'Chris/OuroborosC++' of https://github.com/cjchanx/Avion…
cjchanx Aug 20, 2022
9f29238
Implement basic single-task activity on FlightBoard
cjchanx Sep 3, 2022
8846a44
Merge with remote
cjchanx Sep 3, 2022
d7f69da
Implement VA List mutex for SOAR_ASSERT
cjchanx Sep 10, 2022
efa70a5
Add process for changing .ioc file
cjchanx Sep 10, 2022
739417f
Initial debug and soar assert implementation
cjchanx Sep 10, 2022
8a9b687
Try to add NVIC_SystemReset() to the HF Handler
cjchanx Sep 10, 2022
44ffa32
Update README.md
cjchanx Sep 10, 2022
b4061d3
Update README.md
cjchanx Sep 10, 2022
c365c39
Create README.md
cjchanx Sep 10, 2022
0fa797a
Merge branch 'Chris/OuroborosC++' of https://github.com/cjchanx/Avion…
cjchanx Sep 11, 2022
782de39
Initial Implementation of SOAR_PRINT, Redesign Task Inst Dependency
cjchanx Sep 13, 2022
86d18c1
Cleanup UARTTask Object Routing, Use SOAR_PRINT
cjchanx Sep 16, 2022
84df2dd
Remove unused mutex
cjchanx Sep 16, 2022
6fa8678
Add reset of packet after Handling command
cjchanx Sep 16, 2022
d343b71
Code Review Fixes
cjchanx Sep 16, 2022
5740f3c
Get SOAR_PRINT working
cjchanx Sep 17, 2022
c56ea4d
Documentation and Debug Print Changes
cjchanx Sep 18, 2022
62656cd
Add condition to SOAR_ASSERT so we don't need to wait if the assert h…
cjchanx Sep 18, 2022
d26c170
Format Improvements and Note
cjchanx Sep 18, 2022
be21745
Revert: Add condition to SOAR_ASSERT
cjchanx Sep 18, 2022
fe872ee
Add extra endline
cjchanx Sep 18, 2022
1ec1f96
Add comments for clarification
cjchanx Sep 18, 2022
2d3ea29
Add double instantiation guard to FlightTask
cjchanx Sep 18, 2022
0421815
Add IDE Instructions
cjchanx Sep 21, 2022
4ba5eea
Add new Constructor to Command
cjchanx Sep 21, 2022
f632126
Command:: Object Improvements
cjchanx Sep 22, 2022
57267b7
Change FlightTask:: to Instance Run Style
cjchanx Sep 22, 2022
226dc10
Add defines for ASSERT constants
cjchanx Sep 23, 2022
e8fd4cf
Codegen for UART 5 DMA
cjchanx Sep 23, 2022
ad53020
Fix DMA Handle Ref
cjchanx Sep 23, 2022
0d1474d
Initial Definition for DebugTask::
cjchanx Sep 23, 2022
c7926f8
Init DebugTask
cjchanx Sep 23, 2022
4dc9ac0
Rename Malloc and Free to soar_malloc and soar_free for consistency
cjchanx Sep 23, 2022
342433b
Refactor to nullptr
cjchanx Sep 23, 2022
b13c98c
Update .ioc to Andromeda V3.3
cjchanx Sep 24, 2022
31f6cfa
Remove unused CMake files
cjchanx Sep 24, 2022
62e4b36
Code review fixes for SystemDefines.hpp
cjchanx Sep 24, 2022
95b702f
Code review fixes for Mutex.hpp
cjchanx Sep 24, 2022
701913d
Specify CRC Comments
cjchanx Oct 6, 2022
2169f30
Merge branch 'Chris/OuroborosC++' of https://github.com/StudentOrgani…
cjchanx Oct 6, 2022
c975b74
Refactoring, Utils, Conversions
cjchanx Oct 8, 2022
16ec0ca
Change statAllocationCounter to std::atomic (TODO: TEST THIS)
cjchanx Oct 8, 2022
85a9e3e
Refactoring, DMA Stub
cjchanx Oct 8, 2022
38fa2cb
Move Utils to root
cjchanx Oct 8, 2022
19e07c1
Project Linker, Release, Settings Improvements
cjchanx Oct 8, 2022
2a3d930
Update README.md
cjchanx Oct 8, 2022
739230a
Increase FreeRTOS Heap size to 24KiB
cjchanx Oct 8, 2022
ff1abe3
added timer states and functions to get state
shivamdesai04 Oct 14, 2022
3bbae48
completed funstion removed and other functions have been updated
shivamdesai04 Oct 14, 2022
c0ef82f
added ChangePeriodAndStart function
shivamdesai04 Oct 15, 2022
c5f025f
added new functions and implemented changes stated in code review
shivamdesai04 Oct 15, 2022
04fae0d
added print statement to deconstructor
shivamdesai04 Oct 15, 2022
080bceb
Enabled software timers in ioc file
shivamdesai04 Oct 22, 2022
6c170c9
GetState test code
shivamdesai04 Oct 22, 2022
7a2032d
getstate and destructor testing functions added
shivamdesai04 Oct 22, 2022
acd98d5
added timer test functions
shivamdesai04 Oct 22, 2022
ff2e80c
finished testing functions
shivamdesai04 Oct 22, 2022
7ac5697
Timer test moved to filghttask.cpp
shivamdesai04 Oct 22, 2022
5ba92b6
Test code partly corrected
shivamdesai04 Oct 27, 2022
dd36e61
Merge branch 'master' of https://github.com/StudentOrganisationForAer…
cjchanx Oct 29, 2022
c8145bb
implemeted completed state
shivamdesai04 Nov 10, 2022
9916469
Code Dubugged and Comments added
shivamdesai04 Jan 7, 2023
b0e5e6d
Documentation added
shivamdesai04 Jan 7, 2023
d726bb6
TEST CODE
shivamdesai04 Jan 7, 2023
2498acb
merge conflict resolved
shivamdesai04 Jan 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 129 additions & 21 deletions .cproject

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ STM32L152-Discovery.elf.launch
[Dd]ebug
*.launch

# VS2022
.vs/
24 changes: 12 additions & 12 deletions .mxproject

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
</natures>
</projectDescription>
201 changes: 71 additions & 130 deletions AvionicsSoftware.ioc
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
#MicroXplorer Configuration settings - do not modify
ADC1.Channel-58\#ChannelRegularConversion=ADC_CHANNEL_15
ADC1.ClockPrescaler=ADC_CLOCK_SYNC_PCLK_DIV2
ADC1.ContinuousConvMode=ENABLE
ADC1.DMAContinuousRequests=DISABLE
ADC1.DataAlign=ADC_DATAALIGN_RIGHT
ADC1.DiscontinuousConvMode=DISABLE
ADC1.EOCSelection=ADC_EOC_SEQ_CONV
ADC1.EnableAnalogWatchDog=false
ADC1.ExternalTrigConv=ADC_SOFTWARE_START
ADC1.ExternalTrigConvEdge=ADC_EXTERNALTRIGCONVEDGE_NONE
ADC1.IPParameters=Rank-58\#ChannelRegularConversion,Channel-58\#ChannelRegularConversion,SamplingTime-58\#ChannelRegularConversion,NbrOfConversionFlag,master,ContinuousConvMode,EOCSelection,ExternalTrigConv,ClockPrescaler,Resolution,DataAlign,ScanConvMode,DiscontinuousConvMode,DMAContinuousRequests,NbrOfConversion,ExternalTrigConvEdge,InjNumberOfConversion,EnableAnalogWatchDog
ADC1.InjNumberOfConversion=0
ADC1.NbrOfConversion=1
ADC1.NbrOfConversionFlag=1
ADC1.Rank-58\#ChannelRegularConversion=1
ADC1.Resolution=ADC_RESOLUTION_12B
ADC1.SamplingTime-58\#ChannelRegularConversion=ADC_SAMPLETIME_480CYCLES
ADC1.ScanConvMode=DISABLE
ADC1.master=1
ADC2.Channel-68\#ChannelRegularConversion=ADC_CHANNEL_10
ADC2.ClockPrescaler=ADC_CLOCK_SYNC_PCLK_DIV2
ADC2.ContinuousConvMode=ENABLE
Expand Down Expand Up @@ -50,104 +31,98 @@ Dma.UART4_RX.0.Priority=DMA_PRIORITY_LOW
Dma.UART4_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
FREERTOS.FootprintOK=true
FREERTOS.INCLUDE_vTaskDelayUntil=1
FREERTOS.IPParameters=Tasks01,INCLUDE_vTaskDelayUntil,FootprintOK,configMAX_TASK_NAME_LEN,configUSE_NEWLIB_REENTRANT
FREERTOS.IPParameters=Tasks01,INCLUDE_vTaskDelayUntil,FootprintOK,configMAX_TASK_NAME_LEN,configUSE_NEWLIB_REENTRANT,configTOTAL_HEAP_SIZE,configUSE_TIMERS
FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL
FREERTOS.configMAX_TASK_NAME_LEN=64
FREERTOS.configTOTAL_HEAP_SIZE=24576
FREERTOS.configUSE_NEWLIB_REENTRANT=1
FREERTOS.configUSE_TIMERS=1
File.Version=6
GPIO.groupedBy=Group By Peripherals
KeepUserPlacement=false
Mcu.CPN=STM32F405RGT6
Mcu.Family=STM32F4
Mcu.IP0=ADC1
Mcu.IP1=ADC2
Mcu.IP10=SYS
Mcu.IP11=TIM2
Mcu.IP12=UART4
Mcu.IP13=UART5
Mcu.IP14=USART2
Mcu.IP2=CRC
Mcu.IP3=DMA
Mcu.IP4=FREERTOS
Mcu.IP5=NVIC
Mcu.IP6=RCC
Mcu.IP7=SPI1
Mcu.IP8=SPI2
Mcu.IP9=SPI3
Mcu.IPNb=15
Mcu.IP0=ADC2
Mcu.IP1=CRC
Mcu.IP10=TIM2
Mcu.IP11=UART4
Mcu.IP12=UART5
Mcu.IP13=USART2
Mcu.IP2=DMA
Mcu.IP3=FREERTOS
Mcu.IP4=NVIC
Mcu.IP5=RCC
Mcu.IP6=SPI1
Mcu.IP7=SPI2
Mcu.IP8=SPI3
Mcu.IP9=SYS
Mcu.IPNb=14
Mcu.Name=STM32F405RGTx
Mcu.Package=LQFP64
Mcu.Pin0=PC14-OSC32_IN
Mcu.Pin1=PH0-OSC_IN
Mcu.Pin10=PA4
Mcu.Pin11=PA5
Mcu.Pin12=PA6
Mcu.Pin13=PA7
Mcu.Pin14=PC4
Mcu.Pin15=PC5
Mcu.Pin16=PB0
Mcu.Pin17=PB1
Mcu.Pin18=PB2
Mcu.Pin19=PB10
Mcu.Pin2=PH1-OSC_OUT
Mcu.Pin20=PB11
Mcu.Pin21=PB13
Mcu.Pin22=PB14
Mcu.Pin23=PB15
Mcu.Pin24=PC6
Mcu.Pin25=PC7
Mcu.Pin26=PC8
Mcu.Pin27=PC9
Mcu.Pin28=PA8
Mcu.Pin29=PA13
Mcu.Pin3=PC0
Mcu.Pin30=PA14
Mcu.Pin31=PA15
Mcu.Pin32=PC10
Mcu.Pin33=PC11
Mcu.Pin34=PC12
Mcu.Pin35=PD2
Mcu.Pin36=PB3
Mcu.Pin37=PB4
Mcu.Pin38=PB5
Mcu.Pin39=PB6
Mcu.Pin4=PC2
Mcu.Pin40=PB7
Mcu.Pin41=VP_CRC_VS_CRC
Mcu.Pin42=VP_FREERTOS_VS_CMSIS_V1
Mcu.Pin43=VP_SYS_VS_tim1
Mcu.Pin44=VP_TIM2_VS_ClockSourceINT
Mcu.Pin5=PC3
Mcu.Pin6=PA0-WKUP
Mcu.Pin7=PA1
Mcu.Pin8=PA2
Mcu.Pin9=PA3
Mcu.PinsNb=45
Mcu.Pin0=PH0-OSC_IN
Mcu.Pin1=PH1-OSC_OUT
Mcu.Pin10=PA5
Mcu.Pin11=PA6
Mcu.Pin12=PA7
Mcu.Pin13=PC4
Mcu.Pin14=PB13
Mcu.Pin15=PB14
Mcu.Pin16=PB15
Mcu.Pin17=PC6
Mcu.Pin18=PC7
Mcu.Pin19=PC8
Mcu.Pin2=PC0
Mcu.Pin20=PC9
Mcu.Pin21=PA8
Mcu.Pin22=PA13
Mcu.Pin23=PA14
Mcu.Pin24=PA15
Mcu.Pin25=PC10
Mcu.Pin26=PC11
Mcu.Pin27=PC12
Mcu.Pin28=PD2
Mcu.Pin29=PB3
Mcu.Pin3=PC2
Mcu.Pin30=PB4
Mcu.Pin31=PB5
Mcu.Pin32=PB6
Mcu.Pin33=PB7
Mcu.Pin34=VP_CRC_VS_CRC
Mcu.Pin35=VP_FREERTOS_VS_CMSIS_V1
Mcu.Pin36=VP_SYS_VS_tim1
Mcu.Pin37=VP_TIM2_VS_ClockSourceINT
Mcu.Pin4=PC3
Mcu.Pin5=PA0-WKUP
Mcu.Pin6=PA1
Mcu.Pin7=PA2
Mcu.Pin8=PA3
Mcu.Pin9=PA4
Mcu.PinsNb=38
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F405RGTx
MxCube.Version=6.5.0
MxDb.Version=DB.6.0.50
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
MxCube.Version=6.6.1
MxDb.Version=DB.6.0.60
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.DMA1_Stream2_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:true
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false\:false
NVIC.SavedPendsvIrqHandlerGenerated=true
NVIC.SavedSvcallIrqHandlerGenerated=true
NVIC.SavedSystickIrqHandlerGenerated=true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true\:false
NVIC.TIM1_UP_TIM10_IRQn=true\:15\:0\:false\:false\:true\:false\:false\:true\:true
NVIC.TimeBase=TIM1_UP_TIM10_IRQn
NVIC.TimeBaseIP=TIM1
NVIC.UART5_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.USART2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
PA0-WKUP.GPIOParameters=GPIO_Label
PA0-WKUP.GPIO_Label=GPS_UART_TX
PA0-WKUP.Mode=Asynchronous
Expand Down Expand Up @@ -197,22 +172,6 @@ PA8.GPIOParameters=GPIO_Label
PA8.GPIO_Label=LAUNCH
PA8.Locked=true
PA8.Signal=GPIO_Output
PB0.GPIOParameters=GPIO_Label
PB0.GPIO_Label=OXIDIZER_TANK_ADC
PB0.Locked=true
PB0.Signal=ADCx_IN8
PB1.GPIOParameters=GPIO_Label
PB1.GPIO_Label=PROPULSION_3_VALVE_ADC
PB1.Locked=true
PB1.Signal=ADCx_IN9
PB10.GPIOParameters=GPIO_Label
PB10.GPIO_Label=INJECTION_VALVE
PB10.Locked=true
PB10.Signal=GPIO_Output
PB11.GPIOParameters=GPIO_Label
PB11.GPIO_Label=PROPULSION_3_VALVE
PB11.Locked=true
PB11.Signal=GPIO_Output
PB13.GPIOParameters=GPIO_Label
PB13.GPIO_Label=SPI_FLASH_SCK
PB13.Mode=Full_Duplex_Master
Expand All @@ -225,10 +184,6 @@ PB15.GPIOParameters=GPIO_Label
PB15.GPIO_Label=SPI_FLASH_MOSI
PB15.Mode=Full_Duplex_Master
PB15.Signal=SPI2_MOSI
PB2.GPIOParameters=GPIO_Label
PB2.GPIO_Label=LOWER_VENT_VALVE
PB2.Locked=true
PB2.Signal=GPIO_Output
PB3.Locked=true
PB3.Mode=Trace_Asynchronous_SW
PB3.Signal=SYS_JTDO-SWO
Expand Down Expand Up @@ -268,10 +223,6 @@ PC12.GPIO_Label=DEBUG_UART_TX
PC12.Locked=true
PC12.Mode=Asynchronous
PC12.Signal=UART5_TX
PC14-OSC32_IN.GPIOParameters=GPIO_Label
PC14-OSC32_IN.GPIO_Label=PMB_GPIO_1
PC14-OSC32_IN.Locked=true
PC14-OSC32_IN.Signal=GPIO_Output
PC2.GPIOParameters=GPIO_Label
PC2.GPIO_Label=AUX_2
PC2.Locked=true
Expand All @@ -285,12 +236,8 @@ PC4.GPIOParameters=GPIO_Label
PC4.GPIO_Label=MAG_CS
PC4.Locked=true
PC4.Signal=GPIO_Output
PC5.GPIOParameters=GPIO_Label
PC5.GPIO_Label=COMBUSTION_CHAMBER_ADC
PC5.Locked=true
PC5.Signal=ADCx_IN15
PC6.GPIOParameters=GPIO_Label
PC6.GPIO_Label=KLB_CONTROL
PC6.GPIO_Label=PMB_CONTROL
PC6.Locked=true
PC6.Signal=GPIO_Output
PC7.GPIOParameters=GPIO_Label
Expand Down Expand Up @@ -324,7 +271,7 @@ ProjectManager.CustomerFirmwarePackage=
ProjectManager.DefaultFWLocation=true
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F405RGTx
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.0
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.27.1
ProjectManager.FreePins=true
ProjectManager.HalAssertFull=false
ProjectManager.HeapSize=0x200
Expand All @@ -342,7 +289,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-true,3-MX_ADC1_Init-ADC1-false-HAL-true,4-MX_ADC2_Init-ADC2-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true,6-MX_USART2_UART_Init-USART2-false-HAL-true,7-MX_UART4_Init-UART4-false-HAL-true,8-MX_CRC_Init-CRC-false-HAL-true,9-MX_SPI3_Init-SPI3-false-HAL-true,10-MX_UART5_Init-UART5-false-HAL-true,11-MX_DMA_Init-DMA-false-HAL-true,12-MX_SPI2_Init-SPI2-false-HAL-true,13-MX_TIM2_Init-TIM2-false-HAL-true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-true,3-MX_ADC2_Init-ADC2-false-HAL-true,4-MX_SPI1_Init-SPI1-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true,6-MX_UART4_Init-UART4-false-HAL-true,7-MX_CRC_Init-CRC-false-HAL-true,8-MX_SPI3_Init-SPI3-false-HAL-true,9-MX_UART5_Init-UART5-false-HAL-true,10-MX_DMA_Init-DMA-false-HAL-true,11-MX_SPI2_Init-SPI2-false-HAL-true,12-MX_TIM2_Init-TIM2-false-HAL-true
RCC.48MHZClocksFreq_Value=84000000
RCC.AHBFreq_Value=168000000
RCC.APB1CLKDivider=RCC_HCLK_DIV8
Expand Down Expand Up @@ -378,12 +325,6 @@ RCC.VCOOutputFreq_Value=336000000
RCC.VcooutputI2S=192000000
SH.ADCx_IN10.0=ADC2_IN10,IN10
SH.ADCx_IN10.ConfNb=1
SH.ADCx_IN15.0=ADC1_IN15,IN15
SH.ADCx_IN15.ConfNb=1
SH.ADCx_IN8.0=ADC1_IN8,IN8
SH.ADCx_IN8.ConfNb=1
SH.ADCx_IN9.0=ADC1_IN9,IN9
SH.ADCx_IN9.ConfNb=1
SH.S_TIM2_CH1_ETR.0=TIM2_CH1,PWM Generation1 CH1
SH.S_TIM2_CH1_ETR.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256
Expand Down
56 changes: 56 additions & 0 deletions Components/Communication/Inc/UARTTask.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
******************************************************************************
* File Name : UARTTask.hpp
* Description :
******************************************************************************
*/
#ifndef SOAR_COMMS_UARTTASK_HPP_
#define SOAR_COMMS_UARTTASK_HPP_
/* Includes ------------------------------------------------------------------*/
#include "Task.hpp"
#include "SystemDefines.hpp"



/* Macros ------------------------------------------------------------------*/
enum UART_TASK_COMMANDS {
UART_TASK_COMMAND_NONE = 0,
UART_TASK_COMMAND_SEND_DEBUG,
UART_TASK_COMMAND_MAX
};


/* Class ------------------------------------------------------------------*/
class UARTTask : public Task
{
public:
static UARTTask& Inst() {
static UARTTask inst;
return inst;
}

void InitTask();

protected:
static void RunTask(void* pvParams) { UARTTask::Inst().Run(pvParams); } // Static Task Interface, passes control to the instance Run();

void Run(void* pvParams); // Main run code

void ConfigureUART();
void HandleCommand(Command& cm);

private:
UARTTask() : Task(UART_TASK_QUEUE_DEPTH_OBJS) {} // Private constructor
UARTTask(const UARTTask&); // Prevent copy-construction
UARTTask& operator=(const UARTTask&); // Prevent assignment
};


/* Utility Functions ------------------------------------------------------------------*/
namespace UARTUtils
{

}


#endif // SOAR_COMMS_UARTTASK_HPP_
Loading