1
0
forked from me/IronOS

Improve Key Names, Add Font drawing,Working on modes

This commit is contained in:
Ben V. Brown
2016-09-18 22:43:35 +10:00
parent c7e2713004
commit 5aa27348b5
15 changed files with 363 additions and 190 deletions

View File

@@ -42,8 +42,8 @@ Mcu.Pin9=PA14
Mcu.PinsNb=16
Mcu.UserConstants=
Mcu.UserName=STM32F103T8Ux
MxCube.Version=4.16.0
MxDb.Version=DB.4.0.160
MxCube.Version=4.16.1
MxDb.Version=DB.4.0.161
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true
@@ -107,7 +107,7 @@ PB7.Signal=I2C1_SDA
PCC.Checker=false
PCC.Line=STM32F103
PCC.MCU=STM32F103T(8-B)Ux
PCC.MXVersion=4.16.0
PCC.MXVersion=4.16.1
PCC.PartNumber=STM32F103T8Ux
PCC.Seq0=0
PCC.Series=STM32F1
@@ -127,13 +127,13 @@ ProjectManager.HeapSize=0x200
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=1
ProjectManager.PreviousToolchain=
ProjectManager.PreviousToolchain=SW4STM32
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=TS100.ioc
ProjectManager.ProjectName=TS100
ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=SW4STM32
ProjectManager.ToolChainLocation=/home/ralim/Repo/ts100/TS100
ProjectManager.ToolChainLocation=C\:\\Users\\Ralim\\Repo\\ts100\\TS100
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false,2-MX_I2C1_Init-I2C1-false,3-MX_ADC2_Init-ADC2-false,4-MX_USB_PCD_Init-USB-false,5-MX_ADC1_Init-ADC1-false
RCC.ADCFreqValue=12000000
@@ -147,12 +147,13 @@ RCC.APB2TimFreq_Value=48000000
RCC.FCLKCortexFreq_Value=48000000
RCC.FamilyName=M
RCC.HCLKFreq_Value=48000000
RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtualString,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value
RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSource,PLLSourceVirtual,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value
RCC.MCOFreq_Value=48000000
RCC.PLLCLKFreq_Value=48000000
RCC.PLLMCOFreq_Value=24000000
RCC.PLLMUL=RCC_PLL_MUL12
RCC.PLLSourceVirtualString=RCC_PLLSOURCE_HSI_DIV2
RCC.PLLSource=RCC_PLLSOURCE_HSI_DIV2
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSI_DIV2
RCC.SYSCLKFreq_VALUE=48000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=48000000

View File

@@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1081329009722510400" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1712937092972889568" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@@ -18,7 +18,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1141623289925788796" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="-1773231373176167964" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@@ -26,10 +26,10 @@
//------------------------------ ------------------------------------//
#define KEY_ST(KEY_PIN) GPIO_ReadInputDataBit(GPIOA, KEY_PIN)
#define NO_KEY 0x0 /*NO Keys pressed*/
#define KEY_V1 0x0100/*V1 key pressed*/
#define KEY_V2 0x0040/*V2 Key pressed*/
#define KEY_CN 0X8000/*(Long key press i think)*/
#define KEY_V3 (KEY_V1|KEY_V2)/*Both Keys pressed*/
#define KEY_A 0x0100/*V1 key pressed*/
#define KEY_B 0x0040/*V2 Key pressed*/
#define KEY_CN 0X8000/*(Long key press)*/
#define KEY_V3 (KEY_A|KEY_B)/*Both Keys pressed*/
typedef enum WORK_STATUS {
IDLE = 1, //System is idle

View File

@@ -9,58 +9,79 @@
#define FONT_H_
const u8 FONT[]={
0x00,0x00,0x00,0xE0,0x18,0x06,0x18,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0x03,0x02,0x02,0x02,0x02,0x02,0x03,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,/*A*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x62,0x9C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,/*B*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x04,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x08,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,/*C*/
0x00,0xFE,0x02,0x02,0x02,0x02,0x02,0x04,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x06,0x01,0x00,0x00,0x00,0x00,0x00,/*D*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*E*/
0x00,0xFE,0x42,0x42,0x42,0x42,0x42,0x42,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*F*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x82,0x82,0x84,0x8C,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,/*G*/
0x00,0xFE,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,/*H*/
0x00,0x02,0x02,0xFE,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x1F,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*I*/
0x00,0x00,0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*J*/
0x00,0xFE,0x00,0x80,0xC0,0x20,0x10,0x08,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x01,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*K*/
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*L*/
0x00,0xFE,0x06,0x18,0x60,0x80,0x00,0x80,0x60,0x18,0x06,0xFE,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x01,0x06,0x01,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,/*M*/
0x00,0xFE,0x04,0x08,0x30,0x40,0x80,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x08,0x1F,0x00,0x00,0x00,0x00,0x00,/*N*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x02,0x04,0x0C,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x10,0x10,0x08,0x0C,0x03,0x00,0x00,0x00,0x00,/*O*/
0x00,0xFE,0x02,0x02,0x02,0x02,0x02,0x84,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*P*/
0x00,0xF0,0x0C,0x04,0x02,0x02,0x02,0x02,0x02,0x04,0x0C,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0C,0x08,0x10,0x10,0x10,0x70,0x90,0x88,0x8C,0x83,0x00,0x00,0x00,0x00,/*Q*/
0x00,0xFE,0x82,0x82,0x82,0x82,0x82,0x44,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x00,0x00,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x00,0x00,0x00,0x00,0x00,/*R*/
0x00,0x38,0x44,0x42,0x42,0x82,0x82,0x84,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x04,0x08,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*S*/
0x00,0x02,0x02,0x02,0x02,0xFE,0x02,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*T*/
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x08,0x10,0x10,0x10,0x10,0x10,0x10,0x08,0x07,0x00,0x00,0x00,0x00,0x00,/*U*/
0x00,0x0E,0x30,0xC0,0x00,0x00,0x00,0xC0,0x30,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x06,0x18,0x06,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*V*/
0x00,0x0E,0xF0,0x00,0x00,0x00,0xC0,0x38,0x06,0x38,0xC0,0x00,0x00,0x00,0xF0,0x0E,
0x00,0x00,0x00,0x07,0x18,0x07,0x00,0x00,0x00,0x00,0x00,0x07,0x18,0x07,0x00,0x00,/*W*/
0x00,0x02,0x04,0x18,0x20,0xC0,0x20,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x08,0x06,0x01,0x00,0x01,0x06,0x08,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*X*/
0x00,0x02,0x0C,0x10,0x60,0x80,0x60,0x10,0x0C,0x02,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*Y*/
0x00,0x02,0x02,0x02,0x02,0xC2,0x22,0x12,0x0A,0x06,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x18,0x14,0x12,0x11,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*Z*/
0x00,0xF0,0xFC,0x0E,0x82,0xC2,0x62,0x1E,0xFC,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0F,0x1F,0x11,0x10,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,0x00,/*0*/
0x00,0x08,0x04,0x02,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x1F,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*1*/
0x00,0x04,0x02,0x02,0x02,0xC6,0xFC,0x78,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x18,0x1C,0x16,0x13,0x11,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*2*/
0x00,0x02,0x02,0x42,0x42,0x66,0xFE,0x9C,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x10,0x10,0x08,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*3*/
0x00,0x00,0x80,0xE0,0x30,0x1C,0x06,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x03,0x02,0x02,0x02,0x02,0x1F,0x1F,0x02,0x02,0x00,0x00,0x00,/*4*/
0x00,0x7E,0x7E,0x42,0x42,0x42,0xC2,0x82,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x10,0x10,0x08,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*5*/
0x00,0xE0,0xF8,0x8C,0x44,0x42,0x42,0xC2,0x82,0x80,0x00,0x00,0x00,0x00,
0x00,0x07,0x0F,0x18,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,/*6*/
0x00,0x02,0x02,0x02,0x02,0xC2,0xF2,0x1E,0x06,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*7*/
0x00,0x38,0x7C,0x66,0xC2,0x82,0xC2,0x66,0x7C,0x3C,0x00,0x00,0x00,0x00,
0x00,0x0E,0x0F,0x19,0x10,0x10,0x10,0x19,0x0F,0x0E,0x00,0x00,0x00,0x00,/*8*/
0x00,0x78,0x7C,0xC6,0x82,0x82,0x82,0x46,0xFC,0xF8,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x10,0x10,0x10,0x08,0x0C,0x07,0x03,0x00,0x00,0x00,0x00,/*9*/
0x00,0x00,0x80,0xF0,0x1E,0x02,0x1E,0xF0,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x1C,0x0F,0x03,0x02,0x02,0x02,0x03,0x0F,0x1C,0x00,0x00,0x00,0x00,/*A*/
0x00,0xFE,0xFE,0x42,0x42,0x42,0xE6,0xBE,0x9C,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*B*/
0x00,0xF0,0xF8,0x0C,0x06,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x03,0x0F,0x0C,0x18,0x10,0x10,0x10,0x08,0x00,0x00,0x00,0x00,0x00,/*C*/
0x00,0xFE,0xFE,0x02,0x02,0x02,0x06,0x0C,0xFC,0xF0,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x10,0x10,0x10,0x18,0x0C,0x07,0x03,0x00,0x00,0x00,0x00,/*D*/
0x00,0xFE,0xFE,0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*E*/
0x00,0xFE,0xFE,0x82,0x82,0x82,0x82,0x82,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*F*/
0x00,0xF0,0xF8,0x0C,0x06,0x02,0x82,0x82,0x82,0x84,0x00,0x00,0x00,0x00,
0x00,0x03,0x0F,0x0C,0x18,0x10,0x10,0x10,0x1F,0x1F,0x00,0x00,0x00,0x00,/*G*/
0x00,0xFE,0xFE,0x40,0x40,0x40,0x40,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,/*H*/
0x00,0x02,0x02,0x02,0xFE,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x10,0x10,0x1F,0x1F,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*I*/
0x00,0x02,0x02,0x02,0x02,0x02,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x08,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,0x00,/*J*/
0x00,0xFE,0xFE,0xC0,0xE0,0x30,0x18,0x0C,0x06,0x02,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x00,0x01,0x03,0x06,0x0C,0x18,0x10,0x00,0x00,0x00,0x00,/*K*/
0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,/*L*/
0x00,0x00,0xFE,0x06,0x3C,0xC0,0xC0,0x3C,0x06,0xFE,0x00,0x00,0x00,0x00,
0x00,0x10,0x1F,0x00,0x00,0x01,0x01,0x00,0x00,0x1F,0x18,0x00,0x00,0x00,/*M*/
0x00,0xFE,0xFE,0x1E,0x70,0x80,0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x00,0x00,0x03,0x1C,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,/*N*/
0x00,0xF0,0xFC,0x0C,0x02,0x02,0x02,0x0E,0xFC,0xF0,0x00,0x00,0x00,0x00,
0x00,0x03,0x0F,0x1C,0x10,0x10,0x10,0x0C,0x0F,0x03,0x00,0x00,0x00,0x00,/*O*/
0x00,0xFE,0xFE,0x02,0x02,0x02,0x86,0xFC,0x78,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*P*/
0x00,0xF0,0xF8,0x0C,0x02,0x02,0x02,0x02,0x0C,0xFC,0xF0,0x00,0x00,0x00,
0x00,0x03,0x0F,0x1C,0x10,0x30,0x70,0xD8,0x8C,0x8F,0x83,0x40,0x00,0x00,/*Q*/
0x00,0xFE,0xFE,0x42,0x42,0xC2,0xE6,0x3C,0x1C,0x00,0x00,0x00,0x00,0x00,
0x00,0x1F,0x1F,0x00,0x00,0x00,0x01,0x0F,0x1C,0x10,0x00,0x00,0x00,0x00,/*R*/
0x00,0x38,0x7C,0x66,0xC2,0xC2,0x82,0x84,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x08,0x10,0x10,0x10,0x10,0x19,0x0F,0x07,0x00,0x00,0x00,0x00,0x00,/*S*/
0x00,0x02,0x02,0x02,0x02,0xFE,0xFE,0x02,0x02,0x02,0x02,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*T*/
0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x00,0x00,0x00,0x00,
0x00,0x07,0x0F,0x18,0x10,0x10,0x10,0x18,0x0F,0x07,0x00,0x00,0x00,0x00,/*U*/
0x00,0x0E,0x7E,0xE0,0x00,0x00,0x00,0xE0,0x7C,0x0E,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x03,0x1F,0x18,0x1F,0x03,0x00,0x00,0x00,0x00,0x00,0x00,/*V*/
0x00,0x7E,0xFE,0x00,0x00,0xE0,0xE0,0x00,0x00,0xFE,0x7E,0x00,0x00,0x00,
0x00,0x00,0x1F,0x18,0x0F,0x01,0x01,0x0F,0x18,0x1F,0x00,0x00,0x00,0x00,/*W*/
0x00,0x02,0x06,0x1C,0x38,0xE0,0xE0,0x38,0x1C,0x06,0x02,0x00,0x00,0x00,
0x00,0x10,0x18,0x0E,0x07,0x01,0x01,0x07,0x0E,0x18,0x10,0x00,0x00,0x00,/*X*/
0x00,0x02,0x0E,0x3C,0xF0,0xC0,0xC0,0xF0,0x3C,0x0E,0x02,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*Y*/
0x00,0x02,0x02,0x02,0xC2,0xE2,0x3A,0x0E,0x02,0x00,0x00,0x00,0x00,0x00,
0x00,0x10,0x1C,0x17,0x11,0x10,0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00,/*Z*/
};

View File

@@ -3,67 +3,9 @@
/******************************************************************************/
#ifndef __INTERRUPT_H
#define __INTERRUPT_H
#include <stdint.h>
//See here for refernce to this block http://embedded.kleier.selfhost.me/vector.php
static void forever (void);
void __attribute__ ((weak, alias ("forever"))) WWDG_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) PVD_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TAMPER_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) RTC_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) FLASH_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) RCC_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI0_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI4_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel4_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel5_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel6_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA1_Channel7_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) ADC1_2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) USB_HP_CAN1_TX_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) CAN1_RX1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) CAN1_SCE_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI9_5_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM1_BRK_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM1_UP_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM1_TRG_COM_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM1_CC_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM4_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) I2C1_EV_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) I2C1_ER_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) I2C2_EV_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) I2C2_ER_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) SPI1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) SPI2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) USART1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) USART2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) USART3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) EXTI15_10_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) RTCAlarm_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) USBWakeUp_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM8_BRK_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM8_UP_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM8_TRG_COM_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM8_CC_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) ADC3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) FSMC_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) SDIO_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM5_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) SPI3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) UART4_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) UART5_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM6_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) TIM7_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA2_Channel1_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA2_Channel2_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA2_Channel3_IRQHandler (void);
void __attribute__ ((weak, alias ("forever"))) DMA2_Channel4_5_IRQHandler (void);
/*This loop is used for un assigned IRQ's so that the debugger can catch them*/
void NMI_Handler(void);
void HardFault_Handler(void);
@@ -87,7 +29,69 @@ void I2C1_ER_IRQHandler(void);
void TIM2_IRQHandler(void);
void TIM3_IRQHandler(void);
extern volatile uint32_t system_Ticks;
inline uint32_t millis() {
return system_Ticks;
}
void WWDG_IRQHandler(void);
void PVD_IRQHandler(void);
void TAMPER_IRQHandler(void);
void RTC_IRQHandler(void);
void FLASH_IRQHandler(void);
void RCC_IRQHandler(void);
void EXTI0_IRQHandler(void);
void EXTI1_IRQHandler(void);
void EXTI2_IRQHandler(void);
void EXTI3_IRQHandler(void);
void EXTI4_IRQHandler(void);
void DMA1_Channel1_IRQHandler(void);
void DMA1_Channel2_IRQHandler(void);
void DMA1_Channel3_IRQHandler(void);
void DMA1_Channel4_IRQHandler(void);
void DMA1_Channel5_IRQHandler(void);
void DMA1_Channel6_IRQHandler(void);
void DMA1_Channel7_IRQHandler(void);
void ADC1_2_IRQHandler(void);
void USB_HP_CAN1_TX_IRQHandler(void);
void CAN1_RX1_IRQHandler(void);
void CAN1_SCE_IRQHandler(void);
void EXTI9_5_IRQHandler(void);
void TIM1_BRK_IRQHandler(void);
void TIM1_UP_IRQHandler(void);
void TIM1_TRG_COM_IRQHandler(void);
void TIM1_CC_IRQHandler(void);
void TIM4_IRQHandler(void);
void I2C1_EV_IRQHandler(void);
void I2C1_ER_IRQHandler(void);
void I2C2_EV_IRQHandler(void);
void I2C2_ER_IRQHandler(void);
void SPI1_IRQHandler(void);
void SPI2_IRQHandler(void);
void USART1_IRQHandler(void);
void USART2_IRQHandler(void);
void USART3_IRQHandler(void);
void EXTI15_10_IRQHandler(void);
void RTCAlarm_IRQHandler(void);
void USBWakeUp_IRQHandler(void);
void TIM8_BRK_IRQHandler(void);
void TIM8_UP_IRQHandler(void);
void TIM8_TRG_COM_IRQHandler(void);
void TIM8_CC_IRQHandler(void);
void ADC3_IRQHandler(void);
void FSMC_IRQHandler(void);
void SDIO_IRQHandler(void);
void TIM5_IRQHandler(void);
void SPI3_IRQHandler(void);
void UART4_IRQHandler(void);
void UART5_IRQHandler(void);
void TIM6_IRQHandler(void);
void TIM7_IRQHandler(void);
void DMA2_Channel1_IRQHandler(void);
void DMA2_Channel2_IRQHandler(void);
void DMA2_Channel3_IRQHandler(void);
void DMA2_Channel4_5_IRQHandler(void);
#endif /* __INTERRUPT_H */

View File

@@ -0,0 +1,26 @@
/*
* Modes.h
*
* Created on: 17 Sep 2016
* Author: Ralim
*/
#ifndef MODES_H_
#define MODES_H_
#include "CTRL.h"
#include "Hardware.h"
enum
{
STARTUP,//we are sitting on the prompt to push a button
SOLDERING,
TEMP_ADJ,
SETTINGS,
} operatingMode;
enum {
UVLO,
SLEEP_TEMP,
SLEEP_TIME,
}settingsPage;
#endif /* MODES_H_ */

View File

@@ -1,12 +1,12 @@
/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. **********************
File Name : Oled.h
Version : S100 APP Ver 2.11
Description:
Author : Celery
Data: 2015/07/07
History:
2015/07/07 ͳһ<CDB3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*******************************************************************************/
File Name : Oled.h
Version : S100 APP Ver 2.11
Description:
Author : Celery
Data: 2015/07/07
History:
2015/07/07 ͳһ<CDB3><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*******************************************************************************/
#ifndef _OLED_SSD1306_H
#define _OLED_SSD1306_H
@@ -15,23 +15,23 @@ History:
void Sc_Pt(u8 Co);
void Oled_DisplayOn(void);
void Oled_DisplayOff(void);
u8* Oled_DrawArea(u8 x0,u8 y0,u8 wide, u8 high,u8* ptr);
void Set_ShowPos(u8 x,u8 y);
u8* Oled_DrawArea(u8 x0, u8 y0, u8 wide, u8 high, u8* ptr);
void Set_ShowPos(u8 x, u8 y);
u8* Show_posi(u8 posi,u8* ptr,u8 word_width);
void Clean_Char(int k,u8 wide);
u8* Show_posi(u8 posi, u8* ptr, u8 word_width);
void Clean_Char(int k, u8 wide);
void Write_Command(u8 Data);
void Write_Data(u8 Data);
void GPIO_Init_OLED(void);
void Init_Oled(void);
u8* Data_Command(u8 len,u8* ptr);
void Reg_Command(u8 posi,u8 flag);
u8* Data_Command(u8 len, u8* ptr);
void Reg_Command(u8 posi, u8 flag);
void Clear_Screen(void);
void Write_InitCommand_data(u32 Com_len,u8* data);
void Display_BG(void);
void Write_InitCommand_data(u32 Com_len, u8* data);
void Display_BG(void);
void OLED_DrawString(char* string, uint8_t length);
void OLED_DrawChar(char c, uint8_t x);
void OLED_DrawTwoNumber(uint8_t in, uint8_t x);
#endif
/******************************** END OF FILE *********************************/

View File

@@ -111,6 +111,10 @@ void RCC_Config(void) {
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2 | RCC_APB1Periph_TIM3, ENABLE);
RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_Div1); // USBCLK = 48MHz
RCC_ClocksTypeDef RCC_Clocks;
RCC_GetClocksFreq(&RCC_Clocks);
SysTick_Config(RCC_Clocks.HCLK_Frequency / 1000);//Enable the systick timer
}
/*******************************************************************************
Function: NVIC_Config
@@ -204,7 +208,8 @@ void Adc_Init(void) {
DMA_InitStructure.DMA_BufferSize = 2;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_PeripheralDataSize =
DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
@@ -234,9 +239,12 @@ void Adc_Init(void) {
ADC_Init(ADC2, &ADC_InitStructure);
// ADC1,2 regular channel7 channel9 and channel8 configuration ----------//
ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2, ADC_SampleTime_239Cycles5); //28 or 55
ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 1, ADC_SampleTime_239Cycles5); //28 or 55
ADC_RegularChannelConfig(ADC2, ADC_Channel_9, 1, ADC_SampleTime_55Cycles5); //28 or 55
ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 2,
ADC_SampleTime_239Cycles5); //28 or 55
ADC_RegularChannelConfig(ADC1, ADC_Channel_8, 1,
ADC_SampleTime_239Cycles5); //28 or 55
ADC_RegularChannelConfig(ADC2, ADC_Channel_9, 1,
ADC_SampleTime_55Cycles5); //28 or 55
/* Enable ADC1 DMA */
ADC_DMACmd(ADC1, ENABLE);
@@ -269,8 +277,8 @@ void Init_Timer2(void) {
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; // (48MHz)/48 = 1MHz
TIM_TimeBaseStructure.TIM_Period = 10000 - 1; // Interrupt per 10mS
TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; // (48MHz)/48 = 1MHz
TIM_TimeBaseStructure.TIM_Period = 10000 - 1; // Interrupt per 10mS
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM2, &TIM_TimeBaseStructure);
@@ -296,8 +304,8 @@ void Init_Timer3(void) {
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; //(48MHz)/48 = 1MHz
TIM_TimeBaseStructure.TIM_Period = 50 - 1; // Interrupt per 50us
TIM_TimeBaseStructure.TIM_Prescaler = 48 - 1; //(48MHz)/48 = 1MHz
TIM_TimeBaseStructure.TIM_Period = 50 - 1; // Interrupt per 50us
TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV2;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure);
@@ -320,7 +328,7 @@ void Init_Timer3(void) {
void TIM2_ISR(void) {
volatile static u8 buttonReadDivider;
TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // Clear interrupt flag
TIM_ClearITPendingBit(TIM2, TIM_IT_Update); // Clear interrupt flag
for (u8 i = 0; i < 8; i++)
if (gTime[i] > 0)
gTime[i]--;
@@ -336,7 +344,7 @@ void TIM2_ISR(void) {
void TIM3_ISR(void) {
volatile static u8 heat_flag = 0; //heat flag == used to make the pin toggle
TIM_ClearITPendingBit(TIM3, TIM_IT_Update); // Clear interrupt flag
TIM_ClearITPendingBit(TIM3, TIM_IT_Update); // Clear interrupt flag
if (gTimeOut > 0)
gTimeOut--;

View File

@@ -212,7 +212,7 @@ void Status_Tran(void) //
switch (Get_CtrlStatus()) {
case IDLE:
switch (Get_gKey()) { //Read current switch positions
case KEY_V1: //If V1 key is pressed
case KEY_A: //If V1 key is pressed
if (gIs_restartkey != 1) { //check we are not in a soft restart situation
if (Read_Vb(1) < 4) { //Read that the input voltage is acceptable??
Set_CtrlStatus(SOLDERING_MODE); //Set to temperature controlled mode (Aka soldering mode)
@@ -223,7 +223,7 @@ void Status_Tran(void) //
}
}
break;
case KEY_V2: //check if V2 key is pressed
case KEY_B: //check if V2 key is pressed
if(gIs_restartkey != 1) { //check this is not a soft restart situation
Set_CtrlStatus(THERMOMETER);//Change system to Thermometer mode instead (ie reading temp only, no drive)
UI_TIMER = 0;
@@ -249,8 +249,8 @@ void Status_Tran(void) //
break;
case SOLDERING_MODE: //We are in soldering mode
switch(Get_gKey()) { //switch on the pressed key
case KEY_CN|KEY_V1:
case KEY_CN|KEY_V2://if either key long pressed
case KEY_CN|KEY_A:
case KEY_CN|KEY_B://if either key long pressed
Set_HeatingTime(0);//turn off heater
Set_CtrlStatus(TEMP_SET);//Goto temperature set mode
HEATING_TIMER = 0;//reset heating timer
@@ -386,8 +386,8 @@ void Status_Tran(void) //
}
switch(Get_gKey()) {
case KEY_CN|KEY_V1:
case KEY_CN|KEY_V2:
case KEY_CN|KEY_A:
case KEY_CN|KEY_B:
back_prestatus = 1;
break;
case KEY_CN|KEY_V3:

View File

@@ -107,9 +107,9 @@ void Scan_Key(void) {
u32 key_state = 0;
if ((~GPIOA->IDR) & 0x0200)
key_state |= KEY_V1; //KEY_V1
key_state |= KEY_A; //KEY_V1
if ((~GPIOA->IDR) & 0x0040)
key_state |= KEY_V2; //KEY_V2
key_state |= KEY_B; //KEY_V2
if (key_state == 0)
return;

View File

@@ -5,6 +5,7 @@
#include "Bios.h"
#include "I2C.h"
volatile uint32_t system_Ticks;
/******************************************************************************/
/* Processor Exceptions Handlers */
@@ -44,6 +45,7 @@ void PendSV_Handler(void) {
}
void SysTick_Handler(void) {
++system_Ticks;
}
/******************************************************************************/
@@ -63,13 +65,66 @@ void TIM2_IRQHandler(void) {
void TIM3_IRQHandler(void) {
TIM3_ISR();
}
/*This loop is used for un assigned IRQ's so that the debugger can catch them*/
static void forever()
{
for (;;)
;
}
void WWDG_IRQHandler(void) {}
void PVD_IRQHandler(void) {}
void TAMPER_IRQHandler(void) {}
void RTC_IRQHandler(void){}
void FLASH_IRQHandler(void){}
void RCC_IRQHandler(void){}
void EXTI0_IRQHandler(void){}
void EXTI1_IRQHandler(void){}
void EXTI2_IRQHandler(void){}
void EXTI3_IRQHandler(void){}
void EXTI4_IRQHandler(void){}
void DMA1_Channel1_IRQHandler(void){}
void DMA1_Channel2_IRQHandler(void){}
void DMA1_Channel3_IRQHandler(void){}
void DMA1_Channel4_IRQHandler(void){}
void DMA1_Channel5_IRQHandler(void){}
void DMA1_Channel6_IRQHandler(void){}
void DMA1_Channel7_IRQHandler(void){}
void ADC1_2_IRQHandler(void){}
void USB_HP_CAN1_TX_IRQHandler(void){}
void CAN1_RX1_IRQHandler(void){}
void CAN1_SCE_IRQHandler(void){}
void EXTI9_5_IRQHandler(void){}
void TIM1_BRK_IRQHandler(void){}
void TIM1_UP_IRQHandler(void){}
void TIM1_TRG_COM_IRQHandler(void){}
void TIM1_CC_IRQHandler(void){}
void TIM4_IRQHandler(void){}
void I2C1_EV_IRQHandler(void){}
void I2C1_ER_IRQHandler(void){}
void I2C2_EV_IRQHandler(void){}
void I2C2_ER_IRQHandler(void){}
void SPI1_IRQHandler(void){}
void SPI2_IRQHandler(void){}
void USART1_IRQHandler(void){}
void USART2_IRQHandler(void){}
void USART3_IRQHandler(void){}
void EXTI15_10_IRQHandler(void){}
void RTCAlarm_IRQHandler(void){}
void USBWakeUp_IRQHandler(void){}
void TIM8_BRK_IRQHandler(void){}
void TIM8_UP_IRQHandler(void){}
void TIM8_TRG_COM_IRQHandler(void){}
void TIM8_CC_IRQHandler(void){}
void ADC3_IRQHandler(void){}
void FSMC_IRQHandler(void){}
void SDIO_IRQHandler(void){}
void TIM5_IRQHandler(void){}
void SPI3_IRQHandler(void){}
void UART4_IRQHandler(void){}
void UART5_IRQHandler(void){}
void TIM6_IRQHandler(void){}
void TIM7_IRQHandler(void){}
void DMA2_Channel1_IRQHandler(void){}
void DMA2_Channel2_IRQHandler(void){}
void DMA2_Channel3_IRQHandler(void) {}
void DMA2_Channel4_5_IRQHandler(void){}
/********************************* END OF FILE ******************************/

View File

@@ -19,6 +19,8 @@
#include "Oled.h"
#include "CTRL.h"
#include "Hardware.h"
#include "Interrupt.h"
int main(void) {
RCC_Config(); //setup system clock
//NVIC_Config(0x4000);
@@ -30,8 +32,7 @@ int main(void) {
I2C_Configuration(); //init the i2c bus
Adc_Init(); //init adc and dma
if (Get_CtrlStatus() != USB_POWER)
StartUp_Accelerated(); //start the accelerometer if not in config mode
StartUp_Accelerated(); //start the accelerometer
System_Init(); //load known safe values
Init_Oled(); //init the OLED display
@@ -41,6 +42,13 @@ int main(void) {
Pid_Init(); //init the pid to starting values
Set_gKey(NO_KEY); //reset keys to all off
//OLED_DrawString("TEST012",7);
for (;;) {
OLED_DrawTwoNumber((millis() / 100) % 100, 0);
}
Start_Watchdog(3000); //start the system watchdog as 3 seconds
while (1) {

View File

@@ -0,0 +1,49 @@
/*
* Modes.c
*
* Created on: 17 Sep 2016
* Author: Ralim
*/
#include "Modes.h"
//This does the required processing and state changes
void ProcessUI() {
uint8_t Buttons = Get_gKey(); //read the buttons status
switch (operatingMode) {
case STARTUP:
if (Buttons & KEY_A) {
//A key pressed so we are moving to soldering mode
operatingMode = SOLDERING;
} else if (Buttons & KEY_B) {
//B Button was pressed so we are moving to the Settings menu
operatingMode = SETTINGS;
} else {
//no buttons pressed so we sit tight
}
break;
case SOLDERING:
//We need to check the buttons if we need to jump out
break;
case TEMP_ADJ:
break;
case SETTINGS:
break;
default:
break;
}
}
void DrawUI() {
switch (operatingMode) {
case STARTUP:
break;
case SOLDERING:
break;
case TEMP_ADJ:
break;
case SETTINGS:
break;
default:
break;
}
}

View File

@@ -171,35 +171,36 @@ void Init_Oled(void) {
*******************************************************************************/
void Clear_Screen(void) {
u8 tx_data[128];
u8 i, wd;
#ifdef SSD1316
wd = 32;
#else
wd = 16; //how many lines the display is
#endif
memset(&tx_data[0], 0, 128);
for (i = 0; i < wd / 8; i++) {
for (u8 i = 0; i < 2; i++) {
Oled_DrawArea(0, i * 8, 128, 8, tx_data);
}
}
void OLED_DrawString(char* string, uint8_t length) {
for (uint8_t i = 0; i < length; i++) {
OLED_DrawChar(string[i], i * 16);
OLED_DrawChar(string[i], i * 14);
}
}
void OLED_DrawChar(char c, uint8_t x) {
if ((x) > 112)
if ((x) > (128 - 14))
return; //Rudimentary clipping to not draw off screen
u8* ptr;
u8 temp;
ptr = (u8*) FONT;
if (c >= 'A' && c <= 'Z') {
ptr = (u8*) FONT;
ptr += (c - 'A') * 32;
Oled_DrawArea(x, 0, 16, 16, (u8*) ptr);
}
ptr += (c - 'A' + 10) * (14 * 2);
} else if (c >= '0' && c <= '9')
ptr += (c - '0') * (14 * 2);
else if (c < 10)
ptr += (c) * (14 * 2);
Oled_DrawArea(x, 0, 14, 16, (u8*) ptr);
}
/*
* Draw a 2 digit number to the display
* */
void OLED_DrawTwoNumber(uint8_t in, uint8_t x) {
OLED_DrawChar(in / 10, x);
OLED_DrawChar(in % 10, x + 14);
}
/******************************** END OF FILE *********************************/

View File

@@ -794,7 +794,7 @@ void Temp_SetProc(void) {
Show_Set();
}
switch(Get_gKey()) {
case KEY_V1:
case KEY_A:
if(device_info.t_work > gSet_table[1]) {
gTempset_showctrl = 1;
@@ -808,7 +808,7 @@ void Temp_SetProc(void) {
}
if(device_info.t_work == gSet_table[1]) Show_Triangle(0,1);
break;
case KEY_V2:
case KEY_B:
if(device_info.t_work < gSet_table[0]) {
gTempset_showctrl = 1;
@@ -925,10 +925,10 @@ void OLed_Display(void) {
Clear_Screen();
}
switch(Get_gKey()) {
case KEY_CN|KEY_V1:
case KEY_CN|KEY_A:
config_show = 1;
break;
case KEY_CN|KEY_V2:
case KEY_CN|KEY_B:
config_show = 2;
break;
case KEY_CN|KEY_V3: