yan zhang
/
NB_CLOCK_180505
clock
myKnow/myknow.cpp@3:b8766d623f01, 2018-05-22 (annotated)
- Committer:
- donghuoyinzi
- Date:
- Tue May 22 09:10:05 2018 +0000
- Revision:
- 3:b8766d623f01
- Parent:
- 2:e54d9d87c6cb
0522
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donghuoyinzi | 0:17e9016529cf | 1 | #include "myknow.h" |
donghuoyinzi | 0:17e9016529cf | 2 | |
donghuoyinzi | 0:17e9016529cf | 3 | /*******数据例**********/ |
donghuoyinzi | 0:17e9016529cf | 4 | /*task[]={"001 001 001 5 w xx yy mm dd hh ff ss ",…}; |
donghuoyinzi | 0:17e9016529cf | 5 | 每个元素:依此3段物理模块编址,1位其最终Act编号,1位作用类型,作用(数据地址),6段条件时间。 |
donghuoyinzi | 0:17e9016529cf | 6 | polSta[] = {"k ",…}; |
donghuoyinzi | 0:17e9016529cf | 7 | 每个元素对应各Act的状态。 |
donghuoyinzi | 0:17e9016529cf | 8 | polDat[] = {"1;2;3;4;5;…",…}; |
donghuoyinzi | 0:17e9016529cf | 9 | 每个元素用“;”分开,对应Act输/输出,各Act可共用。 |
donghuoyinzi | 0:17e9016529cf | 10 | */ |
donghuoyinzi | 0:17e9016529cf | 11 | //know::act[]={"n"}; |
donghuoyinzi | 0:17e9016529cf | 12 | //know::assgsta[]={"n"}; |
donghuoyinzi | 3:b8766d623f01 | 13 | char know::task[20][TSK_MAX_LEN]={"n"}; |
donghuoyinzi | 3:b8766d623f01 | 14 | //char know::taskdat[10]={"n"}; |
donghuoyinzi | 1:013b9fdc4e78 | 15 | |
donghuoyinzi | 3:b8766d623f01 | 16 | char know::polSta[100]={'0', |
donghuoyinzi | 0:17e9016529cf | 17 | //knbuildtsk-0 |
donghuoyinzi | 3:b8766d623f01 | 18 | '0','0','0','0','0','0','0','0', |
donghuoyinzi | 1:013b9fdc4e78 | 19 | //4getpow-4,4rst-6,4slepy-7,4isrpc-8 |
donghuoyinzi | 3:b8766d623f01 | 20 | '0','0','0','0','0','0','0','0','0','0','0', |
donghuoyinzi | 2:e54d9d87c6cb | 21 | //b9gettim-14,b9getknw-15,b9put-16,bcgetISR-17,bcsetrtc-18,bcchangdate-19 |
donghuoyinzi | 3:b8766d623f01 | 22 | '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0', |
donghuoyinzi | 1:013b9fdc4e78 | 23 | //cdputsnorm-25,cdputmnorm-26,cdputmchas-27,cdputsstop-28,cdputmstop-29,cdcmpsec-32,cdcmpmin-33,cdcmpsmin-34 |
donghuoyinzi | 3:b8766d623f01 | 24 | '0','0','0','0','0','0','0','0','0','0','0','0','0'}; |
donghuoyinzi | 1:013b9fdc4e78 | 25 | //csgetsec-40,csgetmin-41,csputopen-42,csisrsyst2-46,csisrsyst3-47 |
donghuoyinzi | 3:b8766d623f01 | 26 | |
donghuoyinzi | 3:b8766d623f01 | 27 | char know::polDat[10][DAT_MAX_LEN]= {"n","n", |
donghuoyinzi | 1:013b9fdc4e78 | 28 | //401get-0,401put-1 |
donghuoyinzi | 1:013b9fdc4e78 | 29 | "n","n", |
donghuoyinzi | 1:013b9fdc4e78 | 30 | //b9get-2,b9put-3 |
donghuoyinzi | 1:013b9fdc4e78 | 31 | "n","n", |
donghuoyinzi | 1:013b9fdc4e78 | 32 | //cdget-4,cdput-5 |
donghuoyinzi | 1:013b9fdc4e78 | 33 | "n","n" |
donghuoyinzi | 1:013b9fdc4e78 | 34 | //csget-6,csput-7 |
donghuoyinzi | 1:013b9fdc4e78 | 35 | }; |
donghuoyinzi | 0:17e9016529cf | 36 | |
donghuoyinzi | 0:17e9016529cf | 37 | Serial know::uart1(UART1_TX, UART1_RX); // |
donghuoyinzi | 0:17e9016529cf | 38 | Serial know::uart2(UART2_TX, UART2_RX); // |
donghuoyinzi | 0:17e9016529cf | 39 | Serial know::uart3(UART3_TX, UART3_RX); //BC95和MCU通讯串口 |
donghuoyinzi | 0:17e9016529cf | 40 | |
donghuoyinzi | 0:17e9016529cf | 41 | DigitalOut know::MotS0(SECOND_T0); //PB_13 |
donghuoyinzi | 0:17e9016529cf | 42 | DigitalOut know::MotS1(SECOND_T1); //PB_12 |
donghuoyinzi | 0:17e9016529cf | 43 | DigitalOut know::MotM0(MINITUE_T0); //PB_15 |
donghuoyinzi | 0:17e9016529cf | 44 | DigitalOut know::MotM1(MINITUE_T1); //PB_14 |
donghuoyinzi | 0:17e9016529cf | 45 | |
donghuoyinzi | 0:17e9016529cf | 46 | DigitalOut know::TestO_S(JCOUT_SE); //PA_5 |
donghuoyinzi | 0:17e9016529cf | 47 | DigitalOut know::TestO_M(JCOUT_MI); //PA_6 |
donghuoyinzi | 0:17e9016529cf | 48 | InterruptIn know::TestIn(JCVIN); //PA_4 |
donghuoyinzi | 0:17e9016529cf | 49 | |
donghuoyinzi | 0:17e9016529cf | 50 | AnalogIn know::batAD(BATAD); |
donghuoyinzi | 0:17e9016529cf | 51 | DigitalOut know::pow(POW); //PA_8 |
donghuoyinzi | 0:17e9016529cf | 52 | DigitalOut know::reset(RESET); //PB_9 |
donghuoyinzi | 0:17e9016529cf | 53 | |
donghuoyinzi | 0:17e9016529cf | 54 | DigitalOut know::led1(LED1); //PB_0 |
donghuoyinzi | 0:17e9016529cf | 55 | DigitalOut know::led2(LED2); //PB_1 |
donghuoyinzi | 0:17e9016529cf | 56 | |
donghuoyinzi | 0:17e9016529cf | 57 | Ticker know::time1; //time1 |
donghuoyinzi | 0:17e9016529cf | 58 | Ticker know::time2; //time2 |
donghuoyinzi | 0:17e9016529cf | 59 | Ticker know::time3; //time3 |
donghuoyinzi | 0:17e9016529cf | 60 | |
donghuoyinzi | 0:17e9016529cf | 61 | /***************************************** |
donghuoyinzi | 0:17e9016529cf | 62 | Fun.: 填写任务表 |
donghuoyinzi | 0:17e9016529cf | 63 | Desc.: |
donghuoyinzi | 0:17e9016529cf | 64 | Auth.&Vesion:2017.7.2 |
donghuoyinzi | 0:17e9016529cf | 65 | *****************************************/ |
donghuoyinzi | 0:17e9016529cf | 66 | void knowAct::buildtsk (void) |
donghuoyinzi | 0:17e9016529cf | 67 | { |
donghuoyinzi | 0:17e9016529cf | 68 | //读数据 |
donghuoyinzi | 0:17e9016529cf | 69 | //填写task[],taskdat[] |
donghuoyinzi | 0:17e9016529cf | 70 | } |
donghuoyinzi | 0:17e9016529cf | 71 | |
donghuoyinzi | 0:17e9016529cf | 72 |