You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.6 KiB
46 lines
1.6 KiB
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
|
|
#include "board/project_board.hpp"
|
|
#include "libiflytop_micro\stm32\basic\basic.h"
|
|
#include "libiflytop_micro\stm32\component\tmc\ic\tmc4361A.hpp"
|
|
//
|
|
#include <stdlib.h>
|
|
|
|
#include "board/hardware.hpp"
|
|
#include "libiflytop_micro\stm32\basic\stm32_tim.hpp"
|
|
#include "libiflytop_micro\stm32\basic\zsignal.hpp"
|
|
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\device_base_control_service.hpp"
|
|
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\idcard_reader_service.hpp"
|
|
#include "libiflytop_micro\stm32\component\iflytop_can_slave_module\single_axis_motor_control_v2.hpp"
|
|
#include "libiflytop_micro\stm32\component\iflytop_can_slave_v1\iflytop_can_slave.hpp"
|
|
#include "libiflytop_micro\stm32\component\m3078\m3078_code_scaner.hpp"
|
|
|
|
#define UPDATE_REG(reg, value, periodms) \
|
|
{ \
|
|
static uint32_t lastReportTicket = 0; \
|
|
if (m_hardware.hasPassedMS(lastReportTicket) > (periodms + random(3))) { \
|
|
lastReportTicket = m_hardware.getTicket(); \
|
|
m_protocolStack.writeRegValue(reg, value, false); \
|
|
} \
|
|
}
|
|
namespace iflytop {
|
|
class Main {
|
|
public:
|
|
Hardware m_hardware;
|
|
|
|
Main() {}
|
|
void main(int argc, char const *argv[]);
|
|
|
|
public:
|
|
};
|
|
} // namespace iflytop
|
|
|
|
static iflytop::Main mainObject;
|
|
extern "C" {
|
|
int umain(int argc, char const *argv[]) {
|
|
mainObject.main(argc, argv);
|
|
return 0;
|
|
}
|
|
}
|