diff --git a/python/file/checker_slave_20230908.bin b/python/file/checker_slave_20230908.bin deleted file mode 100644 index 8e5d2e1..0000000 Binary files a/python/file/checker_slave_20230908.bin and /dev/null differ diff --git a/source/ReadMe.txt b/source/ReadMe.txt index 75f4047..610973b 100644 --- a/source/ReadMe.txt +++ b/source/ReadMe.txt @@ -165,5 +165,13 @@ 控制逻辑完成60% 2023.9.9 完成赋码控制,验证通过 +2023.9.12 + 发现开启心跳注码会死机 +2023.9.14 + 启动注码输出通道改到9 + 设置异常报警翻转次数,在次数不为0是只刷新次数不再设置回调 + 急停时管壳挡板设为0(挡住管壳) + 解除急停时解除忙状态 + \ No newline at end of file diff --git a/source/main/compiler_info.h b/source/main/compiler_info.h index e36617f..8fc3218 100644 --- a/source/main/compiler_info.h +++ b/source/main/compiler_info.h @@ -6,7 +6,7 @@ -#define BUILD_DATE "2023-09-11 10:28:07" +#define BUILD_DATE "2023-09-14 17:45:04" #define SOFT_VERSION "0.01" diff --git a/source/mycopy.py b/source/mycopy.py index e9df56f..9720da7 100644 --- a/source/mycopy.py +++ b/source/mycopy.py @@ -164,9 +164,9 @@ def main(): with open(boot_dst,"wb") as f: f.write(d) print(boot_dst+" create boot file success.") - sql=mysql.sql() - if(sql.init(SQL_BOOT_PATH)==True): - sql.insert(boot_dst) + #sql=mysql.sql() + #if(sql.init(SQL_BOOT_PATH)==True): + # sql.insert(boot_dst) else: print("please build bootloader to create boot file") if __name__=="__main__": diff --git a/source/task/process.c b/source/task/process.c index d97c5cc..e31d29f 100644 --- a/source/task/process.c +++ b/source/task/process.c @@ -41,7 +41,7 @@ #define OUTPUT_CLAMP_CYLINDER 2 #define OUTPUT_LED_OK 3 #define OUTPUT_LED_ERR 4 -#define OUTPUT_MARK 7 +#define OUTPUT_MARK 9 // 定义总线选择 #define BUS_SELECT_LEFT 0 @@ -104,6 +104,15 @@ output_set(&s->output[OUTPUT_CLAMP_CYLINDER],0);\ output_set(&s->output[OUTPUT_MARK],0);} +// 设置异常报警次数 +#define SET_ERR_TIMES(t)\ + {if(s->lederr_times>0){\ + s->lederr_times=t;\ + }else{\ + s->lederr_times=t;\ + later_execute(process_err,s,500);}\ + } + typedef struct{ @@ -141,6 +150,7 @@ typedef struct{ void *tran; array_def *code_data;// 赋码数据 rt_timer_t timer; + int lederr_times;// 异常闪烁次数 int busy;// 忙,此时不再响应启动按键 process_step step;// 流程步数0为空闲 int stop_state;// 急停标志,值1时不运行 @@ -182,20 +192,38 @@ static const char *g_errinfo_table[]={ +// 异常报警 +static void process_err(void *arg) +{ + self_def *s=arg; + if(s->lederr_times%2==1) + { + SET_LED_ERR(); + }else{ + SET_LED_OFF(); + } + if(s->lederr_times>0){ + s->lederr_times--; + later_execute(process_err,s,500); + } +} + // 急停按钮响应函数 static void process_stop(void *arg) { self_def *s=arg; s->stop_state=1; - SET_OUTPUT(OUTPUT_SHELL_BAFFLE,1); - SET_LED_ERR(); + // 管壳挡板,0是挡住 + SET_OUTPUT(OUTPUT_SHELL_BAFFLE,0); + SET_ERR_TIMES(3); DBG_LOG("stop key pressed."); } static void process_run(void *arg) { self_def *s=arg; s->stop_state=0; + s->busy=0; SET_LED_OFF(); DBG_LOG("stop key unpressed."); } @@ -236,7 +264,7 @@ static void process_timeout(void *arg) RESET_OUTPUT(); s->busy=0; - SET_LED_ERR(); + SET_ERR_TIMES(3); } // 重置定时器 static void process_timer_start(void *arg) @@ -333,7 +361,7 @@ static void process_end_slot(void *obj,int ack,array_def *data) self_def *s=obj; SAFE_CHECK(s); if(ack){ - SET_LED_ERR(); + SET_ERR_TIMES(3); // 发送异常信息 process_send_errinfo(s); // 发送赋码结果 @@ -387,7 +415,7 @@ static void process_mark_end(void *arg) SAFE_CHECK(s); // 关闭挡板 - SET_OUTPUT(OUTPUT_SHELL_BAFFLE,1); + SET_OUTPUT(OUTPUT_SHELL_BAFFLE,0); SET_OUTPUT(OUTPUT_MARK,0);