Browse Source

编译通过,debug灯闪烁

master
tianjialong 2 years ago
parent
commit
af2fb2a995
  1. 1921
      app/MDK-ARM/app.uvguix.29643
  2. 67
      app/MDK-ARM/app.uvoptx
  3. 25
      src/board/hardware.cpp
  4. 10
      src/board/hardware.hpp
  5. 6
      src/board/project_board.hpp
  6. 6
      src/umain.cpp

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

67
app/MDK-ARM/app.uvoptx

@ -158,72 +158,7 @@
<Name>-U-O142 -O2254 -S0 -C0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_512.FLM -FS08000000 -FL080000 -FP0($$Device:STM32F407VETx$CMSIS\Flash\STM32F4xx_512.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>385</LineNumber>
<EnabledFlag>0</EnabledFlag>
<Address>134242774</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\dep\libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.cpp</Filename>
<ExecCommand></ExecCommand>
<Expression>\\app\../../dep/libiflytop_micro/stm32/component/iflytop_can_slave_v1/iflytop_can_slave.cpp\385</Expression>
</Bp>
<Bp>
<Number>1</Number>
<Type>0</Type>
<LineNumber>346</LineNumber>
<EnabledFlag>0</EnabledFlag>
<Address>134242830</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\dep\libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.cpp</Filename>
<ExecCommand></ExecCommand>
<Expression>\\app\../../dep/libiflytop_micro/stm32/component/iflytop_can_slave_v1/iflytop_can_slave.cpp\346</Expression>
</Bp>
<Bp>
<Number>2</Number>
<Type>0</Type>
<LineNumber>1254</LineNumber>
<EnabledFlag>0</EnabledFlag>
<Address>134220288</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\app\../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c\1254</Expression>
</Bp>
<Bp>
<Number>3</Number>
<Type>0</Type>
<LineNumber>368</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134242972</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>..\..\dep\libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.cpp</Filename>
<ExecCommand></ExecCommand>
<Expression>\\app\../../dep/libiflytop_micro/stm32/component/iflytop_can_slave_v1/iflytop_can_slave.cpp\368</Expression>
</Bp>
</Breakpoint>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>

25
src/board/hardware.cpp

@ -3,6 +3,23 @@
using namespace iflytop;
#define TAG "hardware"
extern "C" {
int fputc(int ch, FILE *stream) {
uint8_t c = ch;
HAL_UART_Transmit(&DEBUG_UART, &c, 1, 100);
return ch;
}
}
void Hardware::hardwareinit() {
debug_light_init();
can_init();
}
void Hardware::periodicJob() {
debug_light_periodicJob();
can_periodicJob();
}
/*******************************************************************************
* *
*******************************************************************************/
@ -16,4 +33,10 @@ void Hardware::debug_light_periodicJob() {
lastprocess = HAL_GetTick();
HAL_GPIO_TogglePin(DEBUG_LIGHT_PORT, DEBUG_LIGHT_PIN);
}
}
}
/*******************************************************************************
* CAN *
*******************************************************************************/
void Hardware::can_init() {}
void Hardware::can_periodicJob() {}

10
src/board/hardware.hpp

@ -3,6 +3,7 @@
#include "board/project_board.hpp"
#include "libiflytop_micro/stm32/basic/basic.h"
#include "libiflytop_micro\stm32\basic\stm32_hal.hpp"
#include "usart.h"
namespace iflytop {
#define MAX_HARDWARE_LISTENER_NUM 5
@ -20,11 +21,20 @@ class Hardware {
public:
Hardware(/* args */){};
~Hardware(){};
void hardwareinit();
void periodicJob();
/*******************************************************************************
* *
*******************************************************************************/
void debug_light_init();
void debug_light_periodicJob();
/*******************************************************************************
* CAN *
*******************************************************************************/
void can_init();
void can_periodicJob();
};
} // namespace iflytop

6
src/board/project_board.hpp

@ -1,6 +1,8 @@
#pragma once
#define VERSION "v1.0" // 调试指示灯
#define VERSION "v1.0" // 调试指示灯
// 调试串口
#define DEBUG_UART huart1
// 调试指示灯
#define DEBUG_LIGHT_PORT GPIOE
#define DEBUG_LIGHT_PIN GPIO_PIN_8

6
src/umain.cpp

@ -6,6 +6,12 @@ using namespace std;
void Main::main(int argc, char const *argv[]) {
sys_loggger_enable(true);
ZLOGI(TAG, "VERSION:%s", VERSION);
m_hardware.hardwareinit();
while (true) {
m_hardware.periodicJob();
}
}
static Main mainObject;

Loading…
Cancel
Save