Browse Source

可以使用串口1打印数据

master
tianjialong 2 years ago
parent
commit
2f26ece7cb
  1. 57
      app/MDK-ARM/app.uvguix.29643
  2. 51
      app/MDK-ARM/app.uvoptx
  3. 11
      usersrc/usermain.c

57
app/MDK-ARM/app.uvguix.29643
File diff suppressed because it is too large
View File

51
app/MDK-ARM/app.uvoptx

@ -133,7 +133,56 @@
<Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32L432KBUx$CMSIS\Flash\STM32L4xx_128.FLM)</Name> <Name>-U-O142 -O2254 -S0 -C0 -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32L432KBUx$CMSIS\Flash\STM32L4xx_128.FLM)</Name>
</SetRegEntry> </SetRegEntry>
</TargetDriverDllRegistry> </TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>80</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>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>87</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>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>107</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>../Core/Src/main.c</Filename>
<ExecCommand></ExecCommand>
<Expression></Expression>
</Bp>
</Breakpoint>
<Tracepoint> <Tracepoint>
<THDelay>0</THDelay> <THDelay>0</THDelay>
</Tracepoint> </Tracepoint>

11
usersrc/usermain.c

@ -5,18 +5,13 @@
#include "main.h" #include "main.h"
#include "usart.h" #include "usart.h"
int fputc(int ch, FILE *stream)
{
uint8_t c = ch;
HAL_UART_Transmit(&huart1, &c, 1, 100);
return ch;
}
void user_main() void user_main()
{ {
uint8_t c = 'o';
while (1) while (1)
{ {
printf("ok\r\n");
HAL_UART_Transmit(&huart1, &c, 1, 100);
HAL_Delay(100);
} }
} }
Loading…
Cancel
Save