This commit is contained in:
Zengtudor 2025-04-12 11:16:45 +08:00
parent 8199ee4c5d
commit 8f264cce0f
5 changed files with 75 additions and 11 deletions

9
EventRecorderStub.scvd Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
<component name="EventRecorderStub" version="1.0.0"/> <!--name and version of the component-->
<events>
</events>
</component_viewer>

View File

@ -115,6 +115,26 @@
<pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon> <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
</DebugOpt> </DebugOpt>
<TargetDriverDllRegistry> <TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMRTXEVENTFLAGS</Key>
<Name>-L70 -Z18 -C0 -M0 -T1</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>ARMDBGFLAGS</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name>(105=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry> <SetRegEntry>
<Number>0</Number> <Number>0</Number>
<Key>ST-LINKIII-KEIL_SWO</Key> <Key>ST-LINKIII-KEIL_SWO</Key>
@ -126,19 +146,36 @@
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM))</Name> <Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_128 -FS08000000 -FL020000 -FP0($$Device:STM32F103C8$Flash\STM32F10x_128.FLM))</Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint/> <Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>21</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>0</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>0</BreakIfRCount>
<Filename>.\Src\main.cpp</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>
<DebugFlag> <DebugFlag>
<trace>0</trace> <trace>0</trace>
<periodic>1</periodic> <periodic>1</periodic>
<aLwin>0</aLwin> <aLwin>1</aLwin>
<aCover>0</aCover> <aCover>0</aCover>
<aSer1>0</aSer1> <aSer1>0</aSer1>
<aSer2>0</aSer2> <aSer2>0</aSer2>
<aPa>0</aPa> <aPa>0</aPa>
<viewmode>0</viewmode> <viewmode>1</viewmode>
<vrSel>0</vrSel> <vrSel>0</vrSel>
<aSym>0</aSym> <aSym>0</aSym>
<aTbox>0</aTbox> <aTbox>0</aTbox>

View File

@ -52,7 +52,7 @@
<OutputName>test</OutputName> <OutputName>test</OutputName>
<CreateExecutable>1</CreateExecutable> <CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib> <CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile> <CreateHexFile>1</CreateHexFile>
<DebugInformation>1</DebugInformation> <DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation> <BrowseInformation>1</BrowseInformation>
<ListingPath>.\Listings\</ListingPath> <ListingPath>.\Listings\</ListingPath>
@ -133,12 +133,12 @@
<UseExternalTool>0</UseExternalTool> <UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent> <RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging> <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>0</Capability> <Capability>1</Capability>
<DriverSelection>-1</DriverSelection> <DriverSelection>4096</DriverSelection>
</Flash1> </Flash1>
<bUseTDR>1</bUseTDR> <bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2> <Flash2>BIN\UL2CM3.DLL</Flash2>
<Flash3></Flash3> <Flash3>"" ()</Flash3>
<Flash4></Flash4> <Flash4></Flash4>
<pFcarmOut></pFcarmOut> <pFcarmOut></pFcarmOut>
<pFcarmGrp></pFcarmGrp> <pFcarmGrp></pFcarmGrp>
@ -311,7 +311,7 @@
</ArmAdsMisc> </ArmAdsMisc>
<Cads> <Cads>
<interw>1</interw> <interw>1</interw>
<Optim>1</Optim> <Optim>3</Optim>
<oTime>0</oTime> <oTime>0</oTime>
<SplitLS>0</SplitLS> <SplitLS>0</SplitLS>
<OneElfS>1</OneElfS> <OneElfS>1</OneElfS>

View File

@ -10,16 +10,19 @@ int main(){
zt::Oled oled(RCC_APB2Periph_GPIOB,GPIOB,GPIO_Pin_8,GPIO_Pin_9); zt::Oled oled(RCC_APB2Periph_GPIOB,GPIOB,GPIO_Pin_8,GPIO_Pin_9);
oled.ShowString(1, 1, "Hello,world!") oled.ShowString(1, 1, "Hello,world!")
.ShowString(2, 1, "by Zengtudor") .ShowString(2, 1, "by Zengtudor")
.ShowString(3, 1, "From BDFS") .ShowString(3, 1, "From BDFS EECRPD")
.ShowString(4, 1, " EEC-RPD"); .ShowString(4, 1, "time:");
u32 delayTime = 500; u32 delayTime = 500;
u32 time = 0;
while(true){ while(true){
time++;
leda0.setOn(); leda0.setOn();
ledc13.setOff(); ledc13.setOff();
delay_ms(delayTime); delay_ms(delayTime);
leda0.setOff(); leda0.setOff();
ledc13.setOn(); ledc13.setOn();
delay_ms(delayTime); delay_ms(delayTime);
oled.ShowUNum(4, 6, time,10);
} }
} }

View File

@ -4,6 +4,9 @@
#include "stm32f10x_gpio.h" #include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h" #include "stm32f10x_rcc.h"
#include "OLED_Font.h" #include "OLED_Font.h"
#include <cstdint>
#include <list>
#include <vector>
namespace zt{ namespace zt{
class Oled{ class Oled{
@ -242,7 +245,7 @@ namespace zt{
* @param Length 1~10 * @param Length 1~10
* @retval * @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; uint8_t i;
for (i = 0; i < Length; i++) for (i = 0; i < Length; i++)
@ -251,6 +254,18 @@ namespace zt{
} }
return *this; return *this;
} }
Oled&ShowUNum(const uint8_t line, const uint8_t column, uint8_t number){
std::list<char> chars;
while(number>0){
chars.push_front(number%10);
number/=10;
}
std::list<char>::iterator it = chars.begin();
for(uint8_t i=0;i<chars.size();i++){
ShowChar(line, column+i, *(it++));
}
return *this;
}
/** /**
* @brief OLED显示数字 * @brief OLED显示数字