aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBen V. Brown <[email protected]>2018-04-14 17:58:28 +1000
committerBen V. Brown <[email protected]>2018-04-14 17:58:28 +1000
commit311d5182eb34d43198f159ab06b65badaa6b4101 (patch)
tree5183291e871636a66b826b800339c9b21f51fc68
parent88ea45d8c8d25e3e63266aac4fad1fc5a9cdc171 (diff)
downloadIronOS-311d5182eb34d43198f159ab06b65badaa6b4101.tar.gz
IronOS-311d5182eb34d43198f159ab06b65badaa6b4101.zip
Cleanup formatting
-rw-r--r--Development Resources/TS100/TS100.ioc85
-rw-r--r--workspace/TS100/src/main.cpp16
2 files changed, 57 insertions, 44 deletions
diff --git a/Development Resources/TS100/TS100.ioc b/Development Resources/TS100/TS100.ioc
index 837f5914..c79fdcc2 100644
--- a/Development Resources/TS100/TS100.ioc
+++ b/Development Resources/TS100/TS100.ioc
@@ -34,36 +34,36 @@ ADC1.SamplingTime-4\#ChannelInjectedConversion=ADC_SAMPLETIME_239CYCLES_5
ADC1.SamplingTime-5\#ChannelInjectedConversion=ADC_SAMPLETIME_71CYCLES_5
ADC1.ScanConvMode=ADC_SCAN_ENABLE
ADC1.master=1
-Dma.ADC1.2.Direction=DMA_PERIPH_TO_MEMORY
-Dma.ADC1.2.Instance=DMA1_Channel1
-Dma.ADC1.2.MemDataAlignment=DMA_MDATAALIGN_HALFWORD
-Dma.ADC1.2.MemInc=DMA_MINC_ENABLE
-Dma.ADC1.2.Mode=DMA_CIRCULAR
-Dma.ADC1.2.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD
-Dma.ADC1.2.PeriphInc=DMA_PINC_DISABLE
-Dma.ADC1.2.Priority=DMA_PRIORITY_VERY_HIGH
-Dma.ADC1.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
-Dma.I2C1_RX.0.Direction=DMA_PERIPH_TO_MEMORY
-Dma.I2C1_RX.0.Instance=DMA1_Channel7
-Dma.I2C1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE
-Dma.I2C1_RX.0.MemInc=DMA_MINC_ENABLE
-Dma.I2C1_RX.0.Mode=DMA_NORMAL
-Dma.I2C1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
-Dma.I2C1_RX.0.PeriphInc=DMA_PINC_DISABLE
-Dma.I2C1_RX.0.Priority=DMA_PRIORITY_MEDIUM
-Dma.I2C1_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
-Dma.I2C1_TX.1.Direction=DMA_MEMORY_TO_PERIPH
-Dma.I2C1_TX.1.Instance=DMA1_Channel6
-Dma.I2C1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE
-Dma.I2C1_TX.1.MemInc=DMA_MINC_ENABLE
-Dma.I2C1_TX.1.Mode=DMA_NORMAL
-Dma.I2C1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
-Dma.I2C1_TX.1.PeriphInc=DMA_PINC_DISABLE
-Dma.I2C1_TX.1.Priority=DMA_PRIORITY_MEDIUM
-Dma.I2C1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
-Dma.Request0=I2C1_RX
-Dma.Request1=I2C1_TX
-Dma.Request2=ADC1
+Dma.ADC1.0.Direction=DMA_PERIPH_TO_MEMORY
+Dma.ADC1.0.Instance=DMA1_Channel1
+Dma.ADC1.0.MemDataAlignment=DMA_MDATAALIGN_HALFWORD
+Dma.ADC1.0.MemInc=DMA_MINC_ENABLE
+Dma.ADC1.0.Mode=DMA_CIRCULAR
+Dma.ADC1.0.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD
+Dma.ADC1.0.PeriphInc=DMA_PINC_DISABLE
+Dma.ADC1.0.Priority=DMA_PRIORITY_VERY_HIGH
+Dma.ADC1.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
+Dma.I2C1_RX.1.Direction=DMA_PERIPH_TO_MEMORY
+Dma.I2C1_RX.1.Instance=DMA1_Channel7
+Dma.I2C1_RX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE
+Dma.I2C1_RX.1.MemInc=DMA_MINC_ENABLE
+Dma.I2C1_RX.1.Mode=DMA_NORMAL
+Dma.I2C1_RX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
+Dma.I2C1_RX.1.PeriphInc=DMA_PINC_DISABLE
+Dma.I2C1_RX.1.Priority=DMA_PRIORITY_MEDIUM
+Dma.I2C1_RX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
+Dma.I2C1_TX.2.Direction=DMA_MEMORY_TO_PERIPH
+Dma.I2C1_TX.2.Instance=DMA1_Channel6
+Dma.I2C1_TX.2.MemDataAlignment=DMA_MDATAALIGN_BYTE
+Dma.I2C1_TX.2.MemInc=DMA_MINC_ENABLE
+Dma.I2C1_TX.2.Mode=DMA_NORMAL
+Dma.I2C1_TX.2.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
+Dma.I2C1_TX.2.PeriphInc=DMA_PINC_DISABLE
+Dma.I2C1_TX.2.Priority=DMA_PRIORITY_MEDIUM
+Dma.I2C1_TX.2.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
+Dma.Request0=ADC1
+Dma.Request1=I2C1_RX
+Dma.Request2=I2C1_TX
Dma.RequestsNb=3
FREERTOS.FootprintOK=true
FREERTOS.INCLUDE_vTaskDelete=0
@@ -89,8 +89,9 @@ Mcu.IP4=IWDG
Mcu.IP5=NVIC
Mcu.IP6=RCC
Mcu.IP7=SYS
-Mcu.IP8=TIM3
-Mcu.IPNb=9
+Mcu.IP8=TIM2
+Mcu.IP9=TIM3
+Mcu.IPNb=10
Mcu.Name=STM32F103T(8-B)Ux
Mcu.Package=VFQFPN36
Mcu.Pin0=PA6
@@ -101,9 +102,12 @@ Mcu.Pin12=PB7
Mcu.Pin13=VP_FREERTOS_VS_ENABLE
Mcu.Pin14=VP_IWDG_VS_IWDG
Mcu.Pin15=VP_SYS_VS_tim1
-Mcu.Pin16=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin17=VP_TIM3_VS_no_output4
+Mcu.Pin16=VP_TIM2_VS_ClockSourceINT
+Mcu.Pin17=VP_TIM2_VS_no_output1
+Mcu.Pin18=VP_TIM2_VS_no_output3
+Mcu.Pin19=VP_TIM3_VS_ClockSourceINT
Mcu.Pin2=PB0
+Mcu.Pin20=VP_TIM3_VS_no_output4
Mcu.Pin3=PB1
Mcu.Pin4=PA8
Mcu.Pin5=PA9
@@ -111,7 +115,7 @@ Mcu.Pin6=PA13
Mcu.Pin7=PA14
Mcu.Pin8=PB3
Mcu.Pin9=PB4
-Mcu.PinsNb=18
+Mcu.PinsNb=21
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F103T8Ux
@@ -220,7 +224,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=SW4STM32
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_I2C1_Init-I2C1-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-SystemClock_Config-RCC-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_IWDG_Init-IWDG-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_I2C1_Init-I2C1-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-SystemClock_Config-RCC-false-HAL-true,6-MX_TIM3_Init-TIM3-false-HAL-true,7-MX_IWDG_Init-IWDG-false-HAL-true,8-MX_TIM2_Init-TIM2-false-HAL-true
RCC.ADCFreqValue=8000000
RCC.ADCPresc=RCC_ADCPCLK2_DIV8
RCC.AHBFreq_Value=64000000
@@ -257,6 +261,9 @@ SH.GPXTI5.0=GPIO_EXTI5
SH.GPXTI5.ConfNb=1
SH.S_TIM3_CH1.0=TIM3_CH1,PWM Generation1 CH1
SH.S_TIM3_CH1.ConfNb=1
+TIM2.Channel-PWM\ Generation1\ No\ Output=TIM_CHANNEL_1
+TIM2.Channel-PWM\ Generation3\ No\ Output=TIM_CHANNEL_3
+TIM2.IPParameters=Channel-PWM Generation1 No Output,Channel-PWM Generation3 No Output
TIM3.Channel-Output\ Compare4\ No\ Output=TIM_CHANNEL_4
TIM3.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
TIM3.ClockDivision=TIM_CLOCKDIVISION_DIV4
@@ -272,6 +279,12 @@ VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_SYS_VS_tim1.Mode=TIM1
VP_SYS_VS_tim1.Signal=SYS_VS_tim1
+VP_TIM2_VS_ClockSourceINT.Mode=Internal
+VP_TIM2_VS_ClockSourceINT.Signal=TIM2_VS_ClockSourceINT
+VP_TIM2_VS_no_output1.Mode=PWM Generation1 No Output
+VP_TIM2_VS_no_output1.Signal=TIM2_VS_no_output1
+VP_TIM2_VS_no_output3.Mode=PWM Generation3 No Output
+VP_TIM2_VS_no_output3.Signal=TIM2_VS_no_output3
VP_TIM3_VS_ClockSourceINT.Mode=Internal
VP_TIM3_VS_ClockSourceINT.Signal=TIM3_VS_ClockSourceINT
VP_TIM3_VS_no_output4.Mode=Output Compare4 No Output
diff --git a/workspace/TS100/src/main.cpp b/workspace/TS100/src/main.cpp
index 40b5867b..e057beb2 100644
--- a/workspace/TS100/src/main.cpp
+++ b/workspace/TS100/src/main.cpp
@@ -571,8 +571,8 @@ static void gui_solderingMode() {
lcd.drawChar(' ');
// Draw heating/cooling symbols
- // If tip PWM > 10% then we are 'heating'
- if (getTipPWM() > 10)
+ // If tip PWM > 30% then we are 'heating'
+ if (getTipPWM() > 30)
lcd.drawSymbol(14);
else
lcd.drawSymbol(15);
@@ -854,8 +854,7 @@ void startPIDTask(void const *argument) {
int32_t integralCount = 0;
int32_t derivativeLastValue = 0;
int32_t kp, ki, kd;
- kp = 40;
- ki = 60;
+ ki = 50;
kd = 15;
// REMEBER ^^^^ These constants are backwards
// They act as dividers, so to 'increase' a P term, you make the number
@@ -863,11 +862,12 @@ void startPIDTask(void const *argument) {
if (getInputVoltageX10(systemSettings.voltageDiv) < 150) {
//Boot P term if < 15 Volts
kp = 30;
- }
+ } else
+ kp = 42;
const int32_t itermMax = 100;
pidTaskNotification = xTaskGetCurrentTaskHandle();
for (;;) {
- ulTaskNotifyTake( pdTRUE, 100); //Wait a max of 100ms
+ ulTaskNotifyTake( pdTRUE, 50); //Wait a max of 50ms
//This is a call to block this thread until the ADC does its samples
uint16_t rawTemp = getTipRawTemp(1); // get instantaneous reading
if (currentlyActiveTemperatureTarget) {
@@ -1098,10 +1098,10 @@ void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c) {
i2cDev.CpltCallback();
}
-void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c){
+void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c) {
i2cDev.CpltCallback();
}
-void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c){
+void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c) {
i2cDev.CpltCallback();
}
void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c) {