aboutsummaryrefslogtreecommitdiffhomepage
path: root/workspace/ts100
diff options
context:
space:
mode:
Diffstat (limited to 'workspace/ts100')
-rw-r--r--workspace/ts100/.cproject4
-rw-r--r--workspace/ts100/LinkerScript.ld10
-rw-r--r--workspace/ts100/inc/APP_Version.h2
-rw-r--r--workspace/ts100/inc/UI.h40
-rw-r--r--workspace/ts100/src/Disk.c2
-rw-r--r--workspace/ts100/src/Hardware.c80
-rw-r--r--workspace/ts100/src/Oled.c123
-rw-r--r--workspace/ts100/src/UI.c93
8 files changed, 77 insertions, 277 deletions
diff --git a/workspace/ts100/.cproject b/workspace/ts100/.cproject
index a061e4ec..f9e92c1f 100644
--- a/workspace/ts100/.cproject
+++ b/workspace/ts100/.cproject
@@ -22,7 +22,7 @@
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="fr.ac6.managedbuild.targetPlatform.gnu.cross.1811524023" isAbstract="false" osList="all" superClass="fr.ac6.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/ts100}/Debug" id="fr.ac6.managedbuild.builder.gnu.cross.727350462" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="fr.ac6.managedbuild.builder.gnu.cross"/>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.1500724168" name="MCU GCC Compiler" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler">
- <option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.963224364" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.more" valueType="enumerated"/>
+ <option id="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level.963224364" name="Optimization Level" superClass="fr.ac6.managedbuild.gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="fr.ac6.managedbuild.gnu.c.optimization.level.size" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.400507088" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1436405353" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${ProjDirPath}/inc&quot;"/>
@@ -45,6 +45,7 @@
</option>
<option id="gnu.c.compiler.option.dialect.std.1983627145" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.c11" valueType="enumerated"/>
<option id="gnu.c.compiler.option.warnings.nowarn.1227270879" name="Inhibit all warnings (-w)" superClass="gnu.c.compiler.option.warnings.nowarn" useByScannerDiscovery="false" value="false" valueType="boolean"/>
+ <option id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.fdata.1556802580" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.fdata" value="true" valueType="boolean"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c.1635097739" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.c"/>
<inputType id="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s.211510996" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.compiler.input.s"/>
</tool>
@@ -54,6 +55,7 @@
</tool>
<tool id="fr.ac6.managedbuild.tool.gnu.cross.c.linker.1345459845" name="MCU GCC Linker" superClass="fr.ac6.managedbuild.tool.gnu.cross.c.linker">
<option id="gnu.c.link.option.ldflags.775824110" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-specs=nosys.specs" valueType="string"/>
+ <option id="gnu.c.link.option.strip.448454656" name="Omit all symbol information (-s)" superClass="gnu.c.link.option.strip" value="false" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1924310651" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
diff --git a/workspace/ts100/LinkerScript.ld b/workspace/ts100/LinkerScript.ld
index b34b6b07..80516a9f 100644
--- a/workspace/ts100/LinkerScript.ld
+++ b/workspace/ts100/LinkerScript.ld
@@ -6,7 +6,7 @@
** Author : Auto-generated by Ac6 System Workbench
**
** Abstract : Linker script for STM32F103T8Ux Device from STM32F1 series
-** 20Kbytes RAM
+** 20Kbytes RAM
** 64Kbytes ROM
**
** Set heap size, stack size and stack location according
@@ -55,16 +55,16 @@ ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20005000; /* end of RAM */
-_Min_Heap_Size = 0; /* required amount of heap */
+_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */
/* Memories definition */
MEMORY
{
- RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
- ROM (rx) : ORIGIN = 0x8000000, LENGTH = 64K
+ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
+ ROM (rx) : ORIGIN = 0x08004000, LENGTH = 36K
}
-
+/*^ The rom is shortened as the last ~10K is used for storing the virtual USB Disk, and the offset at the beginning in the bootloader*/
/* Sections */
SECTIONS
{
diff --git a/workspace/ts100/inc/APP_Version.h b/workspace/ts100/inc/APP_Version.h
index d2893e39..e3ad3308 100644
--- a/workspace/ts100/inc/APP_Version.h
+++ b/workspace/ts100/inc/APP_Version.h
@@ -14,7 +14,7 @@
#define M_VER 'V','0'
#define S_VER '0','1'
#define OEM_TYPE "0"
-#define APP_BASE 0x0800C000
+#define APP_BASE 0x0800C000/*Start address of the virtual disk*/
/*----------------------------------------------------------------------------*/
#ifdef TYPE_DS201
diff --git a/workspace/ts100/inc/UI.h b/workspace/ts100/inc/UI.h
index 24a7ca43..400eb42d 100644
--- a/workspace/ts100/inc/UI.h
+++ b/workspace/ts100/inc/UI.h
@@ -1,12 +1,12 @@
/********************* (C) COPYRIGHT 2015 e-Design Co.,Ltd. **********************
-File Name : UI.h
-Version : S100 APP Ver 2.11
-Description:
-Author : Celery
-Data: 2015/07/07
-History:
-2015/07/07 ͳһ������
-*******************************************************************************/
+ File Name : UI.h
+ Version : S100 APP Ver 2.11
+ Description:
+ Author : Celery
+ Data: 2015/07/07
+ History:
+ 2015/07/07 ͳһ������
+ *******************************************************************************/
#ifndef _UI_H
#define _UI_H
@@ -17,28 +17,28 @@ void Set_UpdataFlag(u32 Cont);
void APP_Init(void);
u32 Calculation_TWork(u8 Flag);
void Temp_SetProc(void);
-void Display_Temp(u8 x,s16 Temp);
+void Display_Temp(u8 x, s16 Temp);
void Show_Notice(void);
void Show_Warning(void);
void Show_MiniTS(void);
-void Show_TempDown(s16 Temp,s16 Dst_Temp);
+void Show_TempDown(s16 Temp, s16 Dst_Temp);
void Set_TemperatureShowFlag(u8 flag);
-s16 TemperatureShow_Change(u8 flag ,s16 Tmp);
+s16 TemperatureShow_Change(u8 flag, s16 Tmp);
u8 Get_TemperatureShowFlag(void);
-void Show_Ver(u8 ver[],u8 flag);
-void Show_Triangle(u8 empty,u8 fill);
-void Shift_Char(u8* ptr,u8 pos);
+
+void Show_Triangle(u8 empty, u8 fill);
+void Shift_Char(u8* ptr, u8 pos);
void Show_Set(void);
-void Show_OrderChar(u8* ptr,u8 num,u8 width);
+void Show_OrderChar(u8* ptr, u8 num, u8 width);
u8 Reverse_Bin8(u8 data);
-void Show_ReverseChar(u8* ptr,u8 num,u8 width,u8 direction);
-u8 Show_TempReverse(u8 num,u8 width,u8 direction);
-void Show_HeatingIcon(u32 ht_flag,u16 active);
+void Show_ReverseChar(u8* ptr, u8 num, u8 width, u8 direction);
+u8 Show_TempReverse(u8 num, u8 width, u8 direction);
+void Show_HeatingIcon(u32 ht_flag, u16 active);
void Display_Str(u8 x, char* str);
void Display_Str10(u8 x, char* str);
void Clear_Pervious(u16 data);
-void Print_Integer(s32 data,u8 posi);
-u8 Roll_Num(u16 Step,u8 Flag);
+void Print_Integer(s32 data, u8 posi);
+u8 Roll_Num(u16 Step, u8 Flag);
void OLed_Display(void);
void Show_Cal(u8 flag);
void Show_Config(void);
diff --git a/workspace/ts100/src/Disk.c b/workspace/ts100/src/Disk.c
index a2b1fb10..7154226f 100644
--- a/workspace/ts100/src/Disk.c
+++ b/workspace/ts100/src/Disk.c
@@ -271,7 +271,7 @@ u8 Cal_Val(u8 str[], u8 k, u8 flag) {
}
/*******************************************************************************
Function:Disk_BuffInit
- Description: Initializes the buffer for the virtual disk.
+ Description: Initializes the buffer for the virtual disk. By loading from the chips flash
*******************************************************************************/
void Disk_BuffInit(void) {
memcpy(gDisk_buff, (u8*) APP_BASE, 0x2600);
diff --git a/workspace/ts100/src/Hardware.c b/workspace/ts100/src/Hardware.c
index cef83d46..0a0294df 100644
--- a/workspace/ts100/src/Hardware.c
+++ b/workspace/ts100/src/Hardware.c
@@ -191,20 +191,23 @@ u32 Get_SlAvg(u32 avg_data) {
}
/*******************************************************************************
- ������: Get_AvgAd
- ��������:��ȡ�������ȶ�ADƽ��ֵ
- �������:NULL
- ���ز���:ADƽ��ֵ
+ Function:
+ Description: Read the thermocouple in the soldering iron head
+ Output:Soldering Iron temperature
*******************************************************************************/
u32 Get_AvgAd(void) {
+ /*The head has a thermocouple inline with the heater
+ This is read by turning off the heater
+ Then read the output of the op-amp that is connected across the connections
+ */
static u32 ad_sum = 0;
static u32 max = 0, min = 5000;
- u32 ad_value, avg_data, slide_data;
+ u32 ad_value, avg_data, slide_data = 0;
- Set_HeatingTime(0);
- HEAT_OFF();
- Delay_HalfMs(25);
- gMeas_cnt = 10;
+ Set_HeatingTime(0); //set the remaining time to zero
+ HEAT_OFF(); //heater must be off
+ Delay_HalfMs(25); //wait for the heater to time out
+ gMeas_cnt = 10; //how many measurements to make
while (gMeas_cnt > 0) {
ad_value = Get_AdcValue(0); //Read_Tmp();
@@ -214,9 +217,9 @@ u32 Get_AvgAd(void) {
if (ad_value < min)
min = ad_value;
- if (gMeas_cnt == 1) {
- ad_sum = ad_sum - max - min;
- avg_data = ad_sum / 8;
+ if (gMeas_cnt == 1) { //We have just taken the last reading
+ ad_sum = ad_sum - max - min; //remove the two outliers
+ avg_data = ad_sum / 8; //take the average
slide_data = Get_SlAvg(avg_data);
ad_sum = 0;
@@ -229,16 +232,14 @@ u32 Get_AvgAd(void) {
}
/*******************************************************************************
- ������: Get_TempSlAvg
- ��������:����¶Ȼ���ƽ��ֵ
- �������:avg_data ����¶�ƽ��ֵ
- ���ز���:����¶Ȼ���ƽ��ֵ
+ Function:
+ Description:
*******************************************************************************/
int Get_TempSlAvg(int avg_data) {
static int sum_avg = 0;
static u8 init_flag = 0;
- if (init_flag == 0) { /*��һ���ϵ�*/
+ if (init_flag == 0) {
sum_avg = 8 * avg_data;
init_flag = 1;
return sum_avg / 8;
@@ -250,14 +251,14 @@ int Get_TempSlAvg(int avg_data) {
}
/*******************************************************************************
- ������: Get_SensorTmp
- ��������:��ȡ����¶�
- �������:NULL
- ���ز���:��ȡ����¶�
+ Function:
+ Description:Reads the temperature of the on board temp sensor for calibration
+ http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf
+ Output: The onboardTemp in C
*******************************************************************************/
int Get_SensorTmp(void) {
- static u32 ad_sum = 0;
- static u32 max = 0, min = 5000;
+ u32 ad_sum = 0;
+ u32 max = 0, min = 5000;
u32 ad_value, avg_data, slide_data;
int sensor_temp = 0;
@@ -277,6 +278,7 @@ int Get_SensorTmp(void) {
//^ Removes the two outliers from the data spread
slide_data = Get_TempSlAvg(avg_data);
sensor_temp = (250 + (3300 * slide_data / 4096) - 750); //(25 + ((10*(33*gSlide_data)/4096)-75));
+ //^ Convert the reading to C
ad_sum = 0;
min = 5000;
max = 0;
@@ -287,25 +289,23 @@ int Get_SensorTmp(void) {
}
/*******************************************************************************
- ������: Zero_Calibration
- ��������:У׼���AD
- �������:NULL
- ���ز���:NULL
+ Function:
+ Description: Reads the Zero Temp.. And does something..
*******************************************************************************/
void Zero_Calibration(void) {
u32 zerop;
int cool_tmp;
- zerop = Get_AvgAd();
- cool_tmp = Get_SensorTmp();
+ zerop = Get_AvgAd(); //get the current
+ cool_tmp = Get_SensorTmp(); //get the temp of the onboard sensor
- if (zerop >= 400) {
+ if (zerop >= 400) { //If the tip is too hot abort
gCalib_flag = 2;
} else {
- if (cool_tmp < 300) {
- gZerop_ad = zerop;
+ if (cool_tmp < 300) { //If cool temp is cool enough continue
+ gZerop_ad = zerop; //store the zero point
gCalib_flag = 1;
- } else {
+ } else { //abort if too warm
gCalib_flag = 2;
}
}
@@ -319,7 +319,6 @@ void Zero_Calibration(void) {
s16 Get_Temp(s16 wk_temp) {
int ad_value, cool_tmp, compensation = 0;
static u16 cnt = 0, h_cnt = 0;
- s16 rl_temp = 0;
ad_value = Get_AvgAd();
cool_tmp = Get_SensorTmp();
@@ -329,16 +328,16 @@ s16 Get_Temp(s16 wk_temp) {
else {
h_cnt = 0;
if (ad_value > 3800 && ad_value < 4095)
- cnt++; //20150720�޸�
+ cnt++;
else
cnt = 0;
}
if (h_cnt >= 60 && cnt == 0)
- gAlarm_type = SEN_ERR; //Sen-err
+ gAlarm_type = SEN_ERR; //Sensor error -- too many invalid readings
if (h_cnt == 0 && cnt >= 10)
- gAlarm_type = HIGH_TEMP; //����
+ gAlarm_type = HIGH_TEMP; //Stuck at a really high temp -> Has mosfet failed
if (h_cnt < 60 && cnt < 10)
- gAlarm_type = NORMAL_TEMP;
+ gAlarm_type = NORMAL_TEMP; //No errors so far
compensation = 80 + 150 * (wk_temp - 1000) / 3000;
if (wk_temp == 1000)
@@ -349,10 +348,9 @@ s16 Get_Temp(s16 wk_temp) {
ad_value -= compensation;
}
if (cool_tmp > 400)
- cool_tmp = 400;
- rl_temp = (ad_value * 1000 + 806 * cool_tmp - gZerop_ad * 1000) / 806;
+ cool_tmp = 400; //cap cool temp at 40C
- return rl_temp;
+ return (ad_value * 1000 + 806 * cool_tmp - gZerop_ad * 1000) / 806;
}
/*******************************************************************************
diff --git a/workspace/ts100/src/Oled.c b/workspace/ts100/src/Oled.c
index 792c07b5..b4237131 100644
--- a/workspace/ts100/src/Oled.c
+++ b/workspace/ts100/src/Oled.c
@@ -18,48 +18,7 @@
#include "Disk.h"
#include "UI.h"
-//Choose startup logo by manufacturer
-#ifdef MFTSEEED
-//V -- Seeed startup logo
-const u8 Seeed[] = {/*12*16*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
- 0x80, 0x00, 0x00, 0xC0, 0xF8, 0x38, 0x04, 0x00, 0x04, 0x38, 0xF8, 0xC0,
- 0x00, 0x00, 0x80, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x30,
- 0x10, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, 0x00, 0x80, 0xC0, 0x60, 0x30,
- 0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x80, 0xC0, 0x60,
- 0x30, 0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x80, 0xC0, 0x60,
- 0x30, 0x10, 0x10, 0x10, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x80, 0xC0,
- 0x40, 0x20, 0x20, 0x20, 0x20, 0x40, 0xC0, 0xFC, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- 0x0F, 0x1C, 0x38, 0x23, 0x6F, 0x5C, 0x00, 0x00, 0x00, 0x5C, 0x6F, 0x23,
- 0x38, 0x1C, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x23,
- 0x42, 0x42, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x07, 0x1E, 0x32, 0x22,
- 0x42, 0x42, 0x42, 0x42, 0x62, 0x32, 0x03, 0x00, 0x00, 0x07, 0x1E, 0x32,
- 0x22, 0x42, 0x42, 0x42, 0x42, 0x22, 0x32, 0x03, 0x00, 0x07, 0x1E, 0x32,
- 0x22, 0x42, 0x42, 0x42, 0x42, 0x62, 0x32, 0x03, 0x00, 0x00, 0x0F, 0x18,
- 0x10, 0x20, 0x20, 0x20, 0x20, 0x10, 0x18, 0x7F, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /*"D:\yinyongqin\��������\LOGOIN.ddMP.bmp",0*/
-};
-#else
-//MiniDSO startup logo
-const u8 Mini[] = {/*12*16*/0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFE,
- 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE,
- 0xFE, 0xFE, 0xFC, 0x78, 0x30, 0x80, 0xC0, 0xC0, 0x00, 0x18, 0x9C, 0xCE,
- 0xE6, 0xF0, 0xF8, 0xFC, 0xFE, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0xE0,
- 0xF0, 0xF8, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x03, 0x07, 0x0F, 0x1F,
- 0x3F, 0x7F, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x03, 0x07, 0x07,
- 0x03, 0x19, 0x1C, 0x0E, 0x67, 0x73, 0x39, 0x1C, 0x0E, 0x07, 0x03, 0x01,
- 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, /*"D:\yinyongqin\��������\LOGOIN.BMP.bmp",0*/
-};
-#endif
+
//Setup params depending on oled model
#ifdef SSD1316
u8 gOled_param[50] = {0x80,0xAE,0x80,0x00,0x80,0x10,0x80,0x40,0x80,0xB0,0x80,
@@ -230,87 +189,7 @@ void Clear_Screen(void) {
Oled_DrawArea(0, i * 8, 128, 8, tx_data);
}
}
-/*******************************************************************************
- Function:Display_BG
- Description:Display the bootup graphics (the logo)
- * Reads the file if present in the filesystem otherwise uses hard coded ones
- *******************************************************************************/
-void Display_BG(void) {
- u8 i, j, k, m, n, p, ch, Palette = 1;
- u8* bmpfile;
- u16 filelen;
- u16* Root_addr = 0;
- u8 *ptr = 0;
- u8 g_au8TxData[128];
-
- if ((bmpfile = SearchFile("LOGOIN BMP", &filelen, Root_addr))) {
- if (bmpfile[0] == 'B' && bmpfile[1] == 'M') {
- if ((bmpfile[0x36] == 0xFF) && (bmpfile[0x37] == 0xFF)
- && (bmpfile[0x38] == 0xFF)) {
- Palette = 0;
- }
- memset(&g_au8TxData[1], 0, 127);
- p = 0x1;
- for (i = 15; i >= 8; i--) {
- m = 0;
- for (j = 0; j < 12; j++) {
- ch = bmpfile[0x3E + i * 12 + j];
- n = 0x80;
- for (k = 0; k < 8; k++) {
- if (Palette) {
- if (!(ch & n))
- g_au8TxData[m + 1] |= p;
- } else {
- if ((ch & n))
- g_au8TxData[m + 1] |= p;
- }
- m++;
- n >>= 1;
- }
- }
- p <<= 1;
- }
- Oled_DrawArea(0, 0, 96, 8, g_au8TxData);
- Clear_Watchdog();
- memset(&g_au8TxData[1], 0, 127);
- p = 0x1;
- for (i = 0; i < 8; i++) {
- m = 0;
- for (j = 0; j < 12; j++) {
- ch = bmpfile[0x3E + (7 - i) * 12 + j];
- n = 0x80;
- for (k = 0; k < 8; k++) {
- if (Palette) {
- if (!(ch & n))
- g_au8TxData[m + 1] |= p;
- } else {
- if ((ch & n))
- g_au8TxData[m + 1] |= p;
- }
- m++;
- n >>= 1;
- }
- }
- p <<= 1;
- }
- Oled_DrawArea(0, 8, 96, 8, g_au8TxData);
- Delay_Ms(1000);
- Clear_Watchdog();
- return;
- }
- } else {
- //Check the #defines for which one to use
-#ifdef MFTSEEED
- ptr = (u8*)Seeed;
-#else
- ptr = (u8*) Mini;
-#endif
- Oled_DrawArea(0, 0, 96, 16, ptr);
- Delay_Ms(1000);
- Clear_Watchdog();
- }
-}
/******************************** END OF FILE *********************************/
diff --git a/workspace/ts100/src/UI.c b/workspace/ts100/src/UI.c
index 8b1e1c6e..4f925517 100644
--- a/workspace/ts100/src/UI.c
+++ b/workspace/ts100/src/UI.c
@@ -26,28 +26,6 @@ u8 gUp_flag = 0, gDown_flag = 0, gLevel_flag = 0, gTempset_showctrl = 0;
u16 gTemp_array_u16[208];
u16 gSet_table[2] = { 4000, 1000 };
u32 gCont = 0;
-
-static u8 Ver_s[] = { /*12*16*/0x04, 0x0C, 0x74, 0x80, 0x00, 0x00, 0x00, 0x80,
- 0x74, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1C, 0x60, 0x1C, 0x03,
- 0x00, 0x00, 0x00, 0x00,/*"V",0*/
- 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x1F, 0x22, 0x42, 0x42, 0x42, 0x42, 0x22, 0x13, 0x00, 0x00, 0x00,/*"e",1*/
- 0x00, 0x40, 0x40, 0xC0, 0x00, 0x80, 0x40, 0x40, 0x40, 0xC0, 0x00, 0x00,
- 0x00, 0x40, 0x40, 0x7F, 0x41, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,/*"r",2*/
- 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,/*":",3*/
- 0x00, 0x78, 0x04, 0x04, 0x04, 0x04, 0x04, 0x88, 0x78, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x50, 0x48, 0x44, 0x42, 0x41, 0x40, 0x70, 0x00, 0x00, 0x00,/*"2",4*/
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,/*".",5*/
- 0x00, 0xE0, 0x18, 0x08, 0x04, 0x04, 0x04, 0x08, 0x18, 0xE0, 0x00, 0x00,
- 0x00, 0x0F, 0x30, 0x20, 0x40, 0x40, 0x40, 0x20, 0x30, 0x0F, 0x00, 0x00,/*"0",6*/
- 0x00, 0x00, 0x00, 0x08, 0x08, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x40, 0x7F, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00,/*"1",7*/
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*" ",5*/
-};
-
/******************************************************************************/
/*******************************************************************************
@@ -196,45 +174,6 @@ void Show_Notice(void) {
if (i == 4)
i = 0;
}
-/*******************************************************************************
- Function:
- Description:
- *******************************************************************************/
-void Show_Ver(u8 ver[], u8 flag) {
- u8 *ptr;
- int k, i;
- u8 temp0 = 0, temp1 = 0, temp2 = 0;
-
- if (ver[2] >= 0x30 && ver[2] < 0x3a)
- temp1 = ver[2] - 0x30; //shift from ascii to the raw value
- if (ver[3] >= 0x30 && ver[3] < 0x3a)
- temp2 = ver[3] - 0x30;
- if (ver[0] >= 0x30 && ver[0] < 0x3a)
- temp0 = ver[0] - 0x30;
-
- for (i = 0; i < 24; i++) {
- Ver_s[4 * 24 + i] = Number12[temp0 * 24 + i];
- Ver_s[6 * 24 + i] = Number12[temp1 * 24 + i];
- Ver_s[7 * 24 + i] = Number12[temp2 * 24 + i];
- }
-
- for (k = 0; k < 16; k++) {
- if (flag == 0) {
- Show_ReverseChar((u8*) Ver_s, 8, 12, 2);
- ptr = (u8*) gTemp_array;
- } else {
- ptr = (u8*) Ver_s;
- }
- for (i = 0; i < 8; i++) {
- ptr = Oled_DrawArea(i * 12, 0, 12, 16, ptr);
- }
- }
- if (flag == 0) {
- Delay_Ms(1000);
- Clear_Screen();
- Clear_Watchdog();
- }
-}
/*******************************************************************************
Function:
@@ -309,7 +248,7 @@ void Show_TempDown(s16 temp, s16 dst_temp) {
*******************************************************************************/
void Show_Cal(u8 flag) {
u8 i;
- u8* ptr;
+ u8* ptr = 0;
if (flag == 1)
ptr = (u8*) Cal_Done;
@@ -329,7 +268,7 @@ void Show_Cal(u8 flag) {
*******************************************************************************/
void Show_Warning(void) {
u8 i;
- u8* ptr;
+ u8* ptr = 0;
static u8 flag = 0;
switch (Get_AlarmType()) {
@@ -367,19 +306,11 @@ void Show_Warning(void) {
fill_trgl: 0,1,2 ��ʵ��,��ʵ��,��ʵ��
*******************************************************************/
void Show_Triangle(u8 empty_trgl, u8 fill_trgl) {
- int j;
u8* ptr;
-
ptr = (u8*) Triangle; //Get pointer to the pre-computed triangle array
-//#TODO Need to come clean this up later..
if ((empty_trgl == 0) && (fill_trgl == 0)) {
- //V-- What is the mess.. im definitly cleaning this up later dont stress
- for (j = 0; j < 2; j++) {
- if (j == 0)
- ptr = Oled_DrawArea(0, 0, 16, 16, (u8*) ptr);
- else if (j == 1)
- ptr = Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr);
- }
+ ptr = Oled_DrawArea(0, 0, 16, 16, (u8*) ptr);
+ ptr = Oled_DrawArea(5 * 16, 0, 16, 16, (u8*) ptr);
} else if ((empty_trgl != 0) && (fill_trgl == 0)) {
if (empty_trgl == 1) {
ptr += 32;
@@ -933,7 +864,7 @@ void Temp_SetProc(void) {
void OLed_Display(void) {
u16 ht_flag;
s16 temp_val, dst_temp;
- static u8 td_flag = 0, ver_flag = 0, config_show = 0;
+ static u8 td_flag = 0, config_show = 0;
static u16 td_cnt = 0;
static u16 bk = 0x33, id_cnt = 0;
@@ -944,11 +875,7 @@ void OLed_Display(void) {
Clear_Screen();
}
- if (ver_flag == 0) {
- Display_BG();
- Show_Ver(device_info.ver, 0);
- ver_flag = 1;
- } else if (UI_TIMER== 0 && G6_TIMER != 0) {
+ if (UI_TIMER== 0 && G6_TIMER != 0) {
Show_Notice();
UI_TIMER = 50;
}
@@ -958,7 +885,7 @@ void OLed_Display(void) {
if(bk == 0) Oled_DisplayOff();
}
if((Get_MmaShift() == 1) || (Get_gKey() != NO_KEY)) {
- G6_TIMER = device_info.idle_time;
+ G6_TIMER = device_info.idle_time; //reset the idle timer
bk = 0x33;
Sc_Pt(bk);
Oled_DisplayOn();
@@ -970,9 +897,7 @@ void OLed_Display(void) {
Set_LongKeyFlag(1);
Clear_Screen();
}
-
ht_flag = Get_HtFlag();
-
if(ht_flag != 1) {
if(td_flag == 1) Clear_Screen();
td_cnt = 0;
@@ -1030,10 +955,6 @@ void OLed_Display(void) {
}
if(config_show == 0) {
Show_Config();
- } else if(config_show == 1) {
- Display_BG();
- } else if(config_show == 2) {
- Show_Ver(device_info.ver,1);
}
if(config_show != 3) {
Set_gKey(NO_KEY);