初版调试完成
This commit is contained in:
@@ -221,12 +221,12 @@
|
||||
|
||||
//< LED
|
||||
#define LED_GREEN_PORTx (PortA)
|
||||
#define LED_GREEN_PINx (Pin09)
|
||||
#define LED_GREEN_PINx (Pin08)
|
||||
#define LED_GREEN_ON() PORT_SetBits(LED_GREEN_PORTx, LED_GREEN_PINx)//拉高
|
||||
#define LED_GREEN_OFF() PORT_ResetBits(LED_GREEN_PORTx, LED_GREEN_PINx)//拉低
|
||||
|
||||
#define LED_RED_PORTx (PortA)
|
||||
#define LED_RED_PINx (Pin08)
|
||||
#define LED_RED_PINx (Pin09)
|
||||
#define LED_RED_ON() PORT_SetBits(LED_RED_PORTx, LED_RED_PINx)//拉高
|
||||
#define LED_RED_OFF() PORT_ResetBits(LED_RED_PORTx, LED_RED_PINx)//拉低
|
||||
|
||||
|
||||
@@ -3,34 +3,25 @@
|
||||
#include <stdlib.h>
|
||||
#include "bsp.h"
|
||||
|
||||
|
||||
#define USE_FILE_SYSTEM 1
|
||||
#define SDCARD_BLOCK_MAX (10000)
|
||||
|
||||
#define OSC_CNT 40
|
||||
#define SLOPE_CNT 20
|
||||
|
||||
#define SLOPE_VPT 1000
|
||||
#define PRESS_VPT 3
|
||||
#define FOLLOW_VPT 10
|
||||
#define SHIELD_VPT 5000
|
||||
#define SHIELD_VPT 8000
|
||||
#define EME_STOP_VPT 4000
|
||||
#define CENTRE_VPT 2000
|
||||
#define CENTRE_VPT 8000
|
||||
#define CENTRE_SHIELD_VPT 2000
|
||||
|
||||
#define STOP_TIME_MS 500
|
||||
#define CENT_TIME_MS 200
|
||||
#define RUN_TIME_MS 0
|
||||
#define EME_START_MS 0
|
||||
#define EME_STOP_MS 2000
|
||||
#define SLOPE_START_MS 3000
|
||||
|
||||
#define TRAVEL_TIME_MS 30000
|
||||
|
||||
#define PEAK 1200 //1200mm
|
||||
#define VALLEY 720 //720mm
|
||||
|
||||
#define BDC_STOP() (SET_TWIN_BIT0(),SET_TWIN_BIT1())
|
||||
#define BDC_DOWN() (SET_TWIN_BIT0(),CLR_TWIN_BIT1())
|
||||
#define BDC_UP() (SET_TWIN_BIT1(),CLR_TWIN_BIT0())
|
||||
#define BDC_STOP() (SET_TWIN_BIT0(),SET_TWIN_BIT1())
|
||||
#define BDC_DOWN() (SET_TWIN_BIT0(),CLR_TWIN_BIT1())
|
||||
#define BDC_UP() (SET_TWIN_BIT1(),CLR_TWIN_BIT0())
|
||||
|
||||
//#define BDC_STOP() Motor_Control(MOTOR_CMD_STOP)
|
||||
//#define BDC_UP() Motor_Control(MOTOR_CMD_FORWARD)
|
||||
@@ -47,7 +38,6 @@ typedef enum {
|
||||
|
||||
/*设备阈值*/
|
||||
typedef struct{
|
||||
int32_t Slope_VPT;
|
||||
int32_t Stop_VPT;
|
||||
|
||||
int32_t LeftUpVPT;//左上设备阈值
|
||||
@@ -66,16 +56,8 @@ typedef struct{
|
||||
int32_t RightLow_Org_AdZero;//右下设备原始AD零点
|
||||
}ADTrack_t;
|
||||
typedef struct{//电机参数
|
||||
bool InitialFlag;//初始标志位
|
||||
bool RestFlag;
|
||||
bool CaliFlag;
|
||||
bool LoopOne;//循环一次标志位
|
||||
int16_t Current_height;//当前高度mm
|
||||
int16_t CaliNum;//标校数量
|
||||
int32_t LU_HeightStress[488];//左上传感器对应高度应力
|
||||
int32_t LL_HeightStress[488];//左下传感器对应高度应力
|
||||
int32_t RU_HeightStress[488];//右上传感器对应高度应力
|
||||
int32_t RL_HeightStress[488];//右上传感器对应高度应力
|
||||
}MotorPara_t;
|
||||
/*数据读取状态机*/
|
||||
typedef enum {
|
||||
@@ -97,22 +79,9 @@ typedef enum {
|
||||
APP_STATUS_IDLE,
|
||||
APP_STATUS_ON,
|
||||
APP_STATUS_OFF,
|
||||
APP_STATUS_MOTOR_INIT,
|
||||
APP_STATUS_WAIT_MOTOR_INIT,
|
||||
APP_STATUS_WAIT_MOTOR_CALI_UP,
|
||||
APP_STATUS_WAIT_MOTOR_CALI_DOWN,
|
||||
APP_STATUS_WAIT_STEADY,
|
||||
APP_STATUS_ZERO_MARKING,
|
||||
APP_STATUS_HEIGHT_CONTROL,
|
||||
}AppStatus_m;
|
||||
|
||||
typedef struct{
|
||||
__IO uint16_t rPayLen;
|
||||
__IO bool HeaderFrame;
|
||||
__IO uint16_t RxLen;
|
||||
uint8_t RxBuff[10];
|
||||
}Uart1Rx_t;
|
||||
|
||||
typedef struct{
|
||||
__IO uint16_t rPayLen;
|
||||
__IO bool HeaderFrame;
|
||||
@@ -124,25 +93,20 @@ typedef struct {
|
||||
AppStatus_m Status;//状态
|
||||
ReadStatus_m RStatus;
|
||||
AppPara_T Para;
|
||||
Uart1Rx_t RxUart1Data;
|
||||
Uart3Rx_t RxUart3Data;
|
||||
|
||||
ADTrack_t ADTrack;
|
||||
MotorPara_t MotorPara;
|
||||
uint32_t TD1mSDelayCnt;
|
||||
uint32_t Read1mSDelayCnt;
|
||||
uint32_t Uart1Delay1mSCnt;
|
||||
uint32_t Read1mSDelayCnt;
|
||||
uint32_t Uart3RxTimeOut1mSCnt;
|
||||
uint32_t StopCollDelay1mSCnt;
|
||||
uint32_t RunCollDelay1mSCnt;
|
||||
uint32_t CentCollDelay1mSCnt;
|
||||
uint32_t EmergencyDelay1mSCnt;
|
||||
uint32_t SlopeCollDelay1mSCnt;
|
||||
uint32_t CailUp1mSCnt;
|
||||
uint32_t HeightContRolCnt;
|
||||
uint8_t FeedDogDlyCnt;
|
||||
|
||||
bool CaliZeroFlag;//校零标志位
|
||||
bool SideFlag;//侧压标志位
|
||||
bool UpFlag;//上升标志位
|
||||
bool DownFlag;//下降标志位
|
||||
bool StopFlag;//停止标志位
|
||||
@@ -165,8 +129,6 @@ typedef struct {
|
||||
int32_t LeftLowCS1237_SlopeArray[SLOPE_CNT];
|
||||
int32_t RightUpCS1237_SlopeArray[SLOPE_CNT];
|
||||
int32_t RightLowCS1237_SlopeArray[SLOPE_CNT];
|
||||
|
||||
bool WaitFlag;
|
||||
}AppDetect_t;
|
||||
extern AppDetect_t App;
|
||||
|
||||
|
||||
+227
-503
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user