From 8f264cce0fb699cba477095bc3a408579e10a4fa Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sat, 12 Apr 2025 11:16:45 +0800 Subject: [PATCH] update --- EventRecorderStub.scvd | 9 +++++++++ Project.uvoptx | 43 +++++++++++++++++++++++++++++++++++++++--- Project.uvprojx | 10 +++++----- Src/main.cpp | 7 +++++-- Src/ztOLED.hpp | 17 ++++++++++++++++- 5 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 EventRecorderStub.scvd diff --git a/EventRecorderStub.scvd b/EventRecorderStub.scvd new file mode 100644 index 0000000..2956b29 --- /dev/null +++ b/EventRecorderStub.scvd @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Project.uvoptx b/Project.uvoptx index 893b155..16ee25b 100644 --- a/Project.uvoptx +++ b/Project.uvoptx @@ -115,6 +115,26 @@ STLink\ST-LINKIII-KEIL_SWO.dll + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + 0 ST-LINKIII-KEIL_SWO @@ -126,19 +146,36 @@ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM)) - + + + 0 + 0 + 21 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + .\Src\main.cpp + + +
+
0 0 1 - 0 + 1 0 0 0 0 - 0 + 1 0 0 0 diff --git a/Project.uvprojx b/Project.uvprojx index c7fd5d8..346bad5 100644 --- a/Project.uvprojx +++ b/Project.uvprojx @@ -52,7 +52,7 @@ test 1 0 - 0 + 1 1 1 .\Listings\ @@ -133,12 +133,12 @@ 0 0 1 - 0 - -1 + 1 + 4096 1 BIN\UL2CM3.DLL - + "" () @@ -311,7 +311,7 @@ 1 - 1 + 3 0 0 1 diff --git a/Src/main.cpp b/Src/main.cpp index c01a392..fcd5428 100644 --- a/Src/main.cpp +++ b/Src/main.cpp @@ -10,16 +10,19 @@ int main(){ zt::Oled oled(RCC_APB2Periph_GPIOB,GPIOB,GPIO_Pin_8,GPIO_Pin_9); oled.ShowString(1, 1, "Hello,world!") .ShowString(2, 1, "by Zengtudor") - .ShowString(3, 1, "From BDFS") - .ShowString(4, 1, " EEC-RPD"); + .ShowString(3, 1, "From BDFS EECRPD") + .ShowString(4, 1, "time:"); u32 delayTime = 500; + u32 time = 0; while(true){ + time++; leda0.setOn(); ledc13.setOff(); delay_ms(delayTime); leda0.setOff(); ledc13.setOn(); delay_ms(delayTime); + oled.ShowUNum(4, 6, time,10); } } \ No newline at end of file diff --git a/Src/ztOLED.hpp b/Src/ztOLED.hpp index 32eb322..2422eef 100644 --- a/Src/ztOLED.hpp +++ b/Src/ztOLED.hpp @@ -4,6 +4,9 @@ #include "stm32f10x_gpio.h" #include "stm32f10x_rcc.h" #include "OLED_Font.h" +#include +#include +#include namespace zt{ class Oled{ @@ -242,7 +245,7 @@ namespace zt{ * @param Length 要显示数字的长度,范围:1~10 * @retval 无 */ - Oled& ShowNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length) + Oled& ShowUNum(uint8_t Line, uint8_t Column, uint32_t Number, uint8_t Length) { uint8_t i; for (i = 0; i < Length; i++) @@ -251,6 +254,18 @@ namespace zt{ } return *this; } + Oled&ShowUNum(const uint8_t line, const uint8_t column, uint8_t number){ + std::list chars; + while(number>0){ + chars.push_front(number%10); + number/=10; + } + std::list::iterator it = chars.begin(); + for(uint8_t i=0;i