Signed-off-by: kevin <kevin@lmve.net>

This commit is contained in:
2022-08-20 22:55:11 +08:00
parent ef5d3d2850
commit 7fa8e263e7
46 changed files with 4233 additions and 3238 deletions
+2 -2
View File
@@ -380,8 +380,8 @@
"idf": "",
"netlist": "",
"specctra_dsn": "",
"step": "Morse_code_PCB.step",
"vrml": ""
"step": "../../Desktop/Morse_code_PCB.step",
"vrml": "../../Desktop/Morse_code_PCB.wrl"
},
"page_layout_descr_file": ""
},
File diff suppressed because it is too large Load Diff
+75
View File
@@ -0,0 +1,75 @@
#include "eeprom.h"
eeprom_write_buff_info eeprom_write_buffer;
void EPPROM_SLOWWRITE_INIT()
{
eeprom_write_buffer.buff=NULL;
eeprom_write_buffer.end=NULL;
eeprom_write_buffer.head=NULL;
eeprom_write_buffer.save_timeout=5;
eeprom_write_buffer.save_busy=0;
}
void EEPROM_SLOWWRITE_SERVER()
{
eeprom_write_buff *buff;
char data;
if(eeprom_write_buffer.save_busy)
{
if(HAL_GetTick()>eeprom_write_buffer.save_time)
{
eeprom_write_buffer.save_busy=0;
}
}else
{
if(eeprom_write_buffer.head!=NULL)
{
eeprom_write_buffer.save_busy=1;
eeprom_write_buffer.save_time=HAL_GetTick()+eeprom_write_buffer.save_timeout;
buff=eeprom_write_buffer.head->next;
data=eeprom_write_buffer.head->date;
IIC_SAND_DATE(EEPROM_ADDRESS,eeprom_write_buffer.head->add,&data,1);
free(eeprom_write_buffer.head);
eeprom_write_buffer.head=buff;
}
}
}
void EEPROM_READ_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
{
IIC_READ_DATE(EEPROM_ADDRESS,IN_DEVICE_ADD,DATAS,LONG);
}
void EEPROM_WRITE_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG)
{
//IIC_SAND_DATE(EEPROM_ADDRESS,IN_DEVICE_ADD,DATAS,LONG);
uint16_t addoffset=0;
eeprom_write_buff *buff;
eeprom_write_buff *buff2;
while(LONG--)
{
buff =(eeprom_write_buff*)malloc(sizeof(eeprom_write_buff));
if(buff!=NULL)
{
buff->add=IN_DEVICE_ADD+addoffset;
buff->date=DATAS[addoffset];
buff->next=NULL;
}else{return ;}
if(eeprom_write_buffer.head==NULL)
{
eeprom_write_buffer.head=buff;
eeprom_write_buffer.end=buff;
}else
{
buff2=eeprom_write_buffer.end;
buff2->next=buff;
eeprom_write_buffer.end=buff;
}
addoffset++;
}
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef EEPROM_H_
#define EEPROM_H_
#include "main.h"
#include "hread_interface.h"
#define EEPROM_ADDRESS 0xa0
typedef struct eeprom_write_buff
{
struct eeprom_write_buff *next;
uint16_t add;
char date;
}eeprom_write_buff;
typedef struct eeprom_write_buff_info
{
eeprom_write_buff *buff;
eeprom_write_buff *head;
eeprom_write_buff *end;
uint32_t save_time;
uint8_t save_timeout;
uint8_t save_busy:1;
}eeprom_write_buff_info;
void EPPROM_SLOWWRITE_INIT();
void EEPROM_SLOWWRITE_SERVER();
void EEPROM_READ_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
void EEPROM_WRITE_BATY(uint16_t IN_DEVICE_ADD,char *DATAS,uint16_t LONG);
#endif
+6 -3
View File
@@ -20,7 +20,7 @@ char config_buzzer_for_sele_change=0;
int config_oled_luminance=100;
char sys_lan=0;
@@ -30,7 +30,7 @@ int mode=0;
uint32_t run_tick=0,jump_tick=0;
uint16_t fps=0,fps_=0;
char sys_lan=0;
int encode_c=0;
@@ -63,7 +63,7 @@ const char * GET_WORD(word*word,char lan)
return word->ch;
break;
}
return "X.X";
}
@@ -343,6 +343,8 @@ void mymain()
HAL_TIM_PWM_Start(&htim2,TIM_CHANNEL_3);//启动n通道的pwm
HAL_TIM_Base_Start_IT(&htim3);
EPPROM_SLOWWRITE_INIT();
OLED_Init();//屏幕初始化
OLED_Setting_luminance(config_oled_luminance);
@@ -429,6 +431,7 @@ void mymain()
mo_server();
BUZZER_PLAY_SERVER();
OLED_Cache_to_hardware();//刷新屏幕
EEPROM_SLOWWRITE_SERVER();
if(HAL_GetTick()>run_tick)
{
+1
View File
@@ -14,6 +14,7 @@
#include "encode.h"
#include "hread_interface.h"
#include "morsr.h"
#include "eeprom.h""
typedef struct
{
File diff suppressed because one or more lines are too long
@@ -531,6 +531,18 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>5</GroupNumber>
<FileNumber>27</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\MYDEIVERS\eeprom.c</PathWithFileName>
<FilenameWithoutPath>eeprom.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
+7 -1
View File
@@ -10,7 +10,7 @@
<TargetName>f103c8t6_KEIL</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<pCCUsed>6180000::V6.18::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@@ -186,6 +186,7 @@
<RvdsVP>0</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<nBranchProt>0</nBranchProt>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@@ -533,6 +534,11 @@
<FileType>1</FileType>
<FilePath>.\MYDEIVERS\morsr.c</FilePath>
</File>
<File>
<FileName>eeprom.c</FileName>
<FileType>1</FileType>
<FilePath>.\MYDEIVERS\eeprom.c</FilePath>
</File>
</Files>
</Group>
<Group>
Binary file not shown.
@@ -0,0 +1,31 @@
f103c8t6_keil/eeprom.o: MYDEIVERS\eeprom.c MYDEIVERS\eeprom.h \
..\Core\Inc\main.h ..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h \
..\Core\Inc\stm32f1xx_hal_conf.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h \
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h \
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h \
..\Drivers\CMSIS\Include\core_cm3.h \
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stdint.h \
..\Drivers\CMSIS\Include\cmsis_version.h \
..\Drivers\CMSIS\Include\cmsis_compiler.h \
..\Drivers\CMSIS\Include\cmsis_armclang.h \
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_compat.h \
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\arm_acle.h \
..\Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h \
C:\Keil_v5\ARM\ARMCLANG\Bin\..\include\stddef.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
MYDEIVERS\hread_interface.h
Binary file not shown.
Binary file not shown.
@@ -3,40 +3,44 @@
<pre>
<h1>µVision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: ¦ÌVision V5.36.0.0
Copyright (C) 2021 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: 1 1, 1, LIC=----
IDE-Version: ¦ÌVision V5.37.0.0
Copyright (C) 2022 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: kevin ng, lmve.net, LIC=----
Tool Versions:
Toolchain: MDK-Lite Version: 5.36.0.0
Toolchain: MDK-Lite Version: 5.37.0.0
Toolchain Path: C:\Keil_v5\ARM\ARMCLANG\Bin
C Compiler: ArmClang.exe V6.16
Assembler: Armasm.exe V6.16
Linker/Locator: ArmLink.exe V6.16
Library Manager: ArmAr.exe V6.16
Hex Converter: FromElf.exe V6.16
CPU DLL: SARMCM3.DLL V5.36.0.0
Dialog DLL: DCM.DLL V1.17.3.0
C Compiler: ArmClang.exe V6.18
Assembler: Armasm.exe V6.18
Linker/Locator: ArmLink.exe V6.18
Library Manager: ArmAr.exe V6.18
Hex Converter: FromElf.exe V6.18
CPU DLL: SARMCM3.DLL V5.37.0.0
Dialog DLL: DCM.DLL V1.17.5.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V3.0.9.0
Dialog DLL: TCM.DLL V1.53.0.0
Dialog DLL: TCM.DLL V1.56.1.0
<h2>Project:</h2>
C:\Users\kevin\Desktop\morse_code_trainer\f103c8t6_keil\MDK-ARM\f103c8t6_KEIL.uvprojx
Project File Date: 08/18/2022
C:\Users\wuwen\morse_code_trainer\f103c8t6_keil\MDK-ARM\f103c8t6_KEIL.uvprojx
Project File Date: 08/20/2022
<h2>Output:</h2>
*** Using Compiler 'V6.16', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
*** Using Compiler 'V6.18', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin'
Build target 'f103c8t6_KEIL'
compiling main.c...
MYDEIVERS/mymain.c(7): warning: In file included from...
./MYDEIVERS/mymain.h(17): warning: missing terminating '"' character [-Winvalid-pp-token]
#include "eeprom.h""
^
./MYDEIVERS/mymain.h(17): warning: extra tokens at end of #include directive [-Wextra-tokens]
#include "eeprom.h""
^
//
MYDEIVERS/mymain.c(46): warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"<BF><AA>"
^~~~~~~~
MYDEIVERS/mymain.c(52): warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"<B9><D8>"
^~~~~~~~
MYDEIVERS/mymain.c(67): warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
MYDEIVERS/mymain.c(100): warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
OLED_Str_list(0,0,16,list,m->list_dis_top,4,1);
^~~~
@@ -104,21 +108,20 @@ MYDEIVERS/mymain.c(302): warning: illegal character encoding in string literal [
MYDEIVERS/mymain.c(305): warning: incompatible pointer types assigning to 'char *' from 'char (*)[32]' [-Wincompatible-pointer-types]
display_setting.r_sw_list=&str;
^~~~~
24 warnings generated.
25 warnings generated.
compiling mymain.c...
compiling oled.c...
linking...
Program Size: Code=16996 RO-data=5208 RW-data=132 ZI-data=4188
Program Size: Code=17384 RO-data=5216 RW-data=132 ZI-data=4204
FromELF: creating hex file...
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 24 Warning(s).
"f103c8t6_KEIL\f103c8t6_KEIL.axf" - 0 Error(s), 25 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.5.8.0.pack
ARM.CMSIS.5.8.0
http://www.keil.com/pack/ARM.CMSIS.5.9.0.pack
ARM.CMSIS.5.9.0
CMSIS (Common Microcontroller Software Interface Standard)
* Component: CORE Version: 5.5.0
* Component: CORE Version: 5.6.0
Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F1xx_DFP.2.4.0.pack
@@ -126,15 +129,15 @@ Package Vendor: Keil
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
<h2>Collection of Component include folders:</h2>
.\RTE\_f103c8t6_KEIL
C:\Users\kevin\AppData\Local\Arm\Packs\ARM\CMSIS\5.8.0\CMSIS\Core\Include
C:\Users\kevin\AppData\Local\Arm\Packs\Keil\STM32F1xx_DFP\2.4.0\Device\Include
./RTE/_f103c8t6_KEIL
C:/Users/wuwen/AppData/Local/Arm/Packs/ARM/CMSIS/5.9.0/CMSIS/Core/Include
C:/Users/wuwen/AppData/Local/Arm/Packs/Keil/STM32F1xx_DFP/2.4.0/Device/Include
<h2>Collection of Component Files used:</h2>
* Component: ARM::CMSIS:CORE:5.5.0
Include file: CMSIS\Core\Include\tz_context.h
Build Time Elapsed: 00:00:02
* Component: ARM::CMSIS:CORE:5.6.0
Include file: CMSIS/Core/Include/tz_context.h
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -25,6 +25,7 @@
"f103c8t6_keil\buzzer.o"
"f103c8t6_keil\encode.o"
"f103c8t6_keil\morsr.o"
"f103c8t6_keil\eeprom.o"
--strict --scatter "f103c8t6_KEIL\f103c8t6_KEIL.sct"
--summary_stderr --info summarysizes --map --load_addr_map_info --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
Binary file not shown.
+2 -1
View File
@@ -29,4 +29,5 @@ f103c8t6_keil/main.o: ..\Core\Src\main.c ..\Core\Inc\main.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
MYDEIVERS\mymain.h MYDEIVERS\oled.h MYDEIVERS\hread_interface.h \
MYDEIVERS\buzzer.h MYDEIVERS\encode.h MYDEIVERS\morsr.h
MYDEIVERS\buzzer.h MYDEIVERS\encode.h MYDEIVERS\morsr.h \
MYDEIVERS\eeprom.h
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -29,4 +29,4 @@ f103c8t6_keil/mymain.o: MYDEIVERS\mymain.c MYDEIVERS\mymain.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h \
..\Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h \
MYDEIVERS\oled.h MYDEIVERS\hread_interface.h MYDEIVERS\buzzer.h \
MYDEIVERS\encode.h MYDEIVERS\morsr.h
MYDEIVERS\encode.h MYDEIVERS\morsr.h MYDEIVERS\eeprom.h
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.