yan zhang
/
NB_CLOCK_180505
clock
myKnow/myknow.cpp@0:17e9016529cf, 2018-05-08 (annotated)
- Committer:
- donghuoyinzi
- Date:
- Tue May 08 02:13:50 2018 +0000
- Revision:
- 0:17e9016529cf
- Child:
- 1:013b9fdc4e78
CLOCK_needle_180508
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 | 0:17e9016529cf | 13 | string know::task[]={"n"}; |
donghuoyinzi | 0:17e9016529cf | 14 | string know::taskdat[]={"n"}; |
donghuoyinzi | 0:17e9016529cf | 15 | string know::polSta[]={"n", |
donghuoyinzi | 0:17e9016529cf | 16 | //knbuildtsk-0 |
donghuoyinzi | 0:17e9016529cf | 17 | "n","n","n","n","n","n","n","n", |
donghuoyinzi | 0:17e9016529cf | 18 | //4init-1,4ready-2,4revoke-3,4getpow-4,4rwdg-5,4rst-6,4slepy-7,4isrpc-8 |
donghuoyinzi | 0:17e9016529cf | 19 | "n","n","n","n","n","n","n","n","n","n","n", |
donghuoyinzi | 0:17e9016529cf | 20 | //b9init-9,b9start-10,b9data-11,b9ready-12,b9revok-13,b9gettim-14,b9getknw-15,b9put-16,bcgetISR-17,bcsetrtc-18,bcchangdate-19 |
donghuoyinzi | 0:17e9016529cf | 21 | "n","n","n","n","n","n","n","n","n","n","n","n","n","n","n", |
donghuoyinzi | 0:17e9016529cf | 22 | //cdinit-20,cdstart-21,cddata-22,cdready-23,cdputrevok-24,cdputsnorm-25,cdputmnorm-26,cdputmchas-27,cdputsstop-28,cdputmstop-29, |
donghuoyinzi | 0:17e9016529cf | 23 | //cdputszero-30,cdputmzero-31,cdcmpsec-32,cdcmpmin-33,cdcmpsmin-34 |
donghuoyinzi | 0:17e9016529cf | 24 | "n","n","n","n","n","n","n","n","n","n","n","n","n", |
donghuoyinzi | 0:17e9016529cf | 25 | //csinit-35,csstart-36,csdata-37,csready-38,csrevok-39,csgetsec-40,csgetmin-41,csputopen-42,csjudgsec-43,csjudgmin-44,csisrsyst1-45, |
donghuoyinzi | 0:17e9016529cf | 26 | //csisrsyst2-46,csisrsyst3-47 |
donghuoyinzi | 0:17e9016529cf | 27 | }; |
donghuoyinzi | 0:17e9016529cf | 28 | |
donghuoyinzi | 0:17e9016529cf | 29 | string know::polDat[]={"n","n", |
donghuoyinzi | 0:17e9016529cf | 30 | //401get-0,401put-1 |
donghuoyinzi | 0:17e9016529cf | 31 | "n","n", |
donghuoyinzi | 0:17e9016529cf | 32 | //b9get-2,b9put-3 |
donghuoyinzi | 0:17e9016529cf | 33 | "n","n", |
donghuoyinzi | 0:17e9016529cf | 34 | //cdget-4,cdput-5 |
donghuoyinzi | 0:17e9016529cf | 35 | "n","n", |
donghuoyinzi | 0:17e9016529cf | 36 | //csget-6,csput-7 |
donghuoyinzi | 0:17e9016529cf | 37 | }; |
donghuoyinzi | 0:17e9016529cf | 38 | |
donghuoyinzi | 0:17e9016529cf | 39 | Serial know::uart1(UART1_TX, UART1_RX); // |
donghuoyinzi | 0:17e9016529cf | 40 | Serial know::uart2(UART2_TX, UART2_RX); // |
donghuoyinzi | 0:17e9016529cf | 41 | Serial know::uart3(UART3_TX, UART3_RX); //BC95和MCU通讯串口 |
donghuoyinzi | 0:17e9016529cf | 42 | |
donghuoyinzi | 0:17e9016529cf | 43 | DigitalOut know::MotS0(SECOND_T0); //PB_13 |
donghuoyinzi | 0:17e9016529cf | 44 | DigitalOut know::MotS1(SECOND_T1); //PB_12 |
donghuoyinzi | 0:17e9016529cf | 45 | DigitalOut know::MotM0(MINITUE_T0); //PB_15 |
donghuoyinzi | 0:17e9016529cf | 46 | DigitalOut know::MotM1(MINITUE_T1); //PB_14 |
donghuoyinzi | 0:17e9016529cf | 47 | |
donghuoyinzi | 0:17e9016529cf | 48 | DigitalOut know::TestO_S(JCOUT_SE); //PA_5 |
donghuoyinzi | 0:17e9016529cf | 49 | DigitalOut know::TestO_M(JCOUT_MI); //PA_6 |
donghuoyinzi | 0:17e9016529cf | 50 | InterruptIn know::TestIn(JCVIN); //PA_4 |
donghuoyinzi | 0:17e9016529cf | 51 | |
donghuoyinzi | 0:17e9016529cf | 52 | AnalogIn know::batAD(BATAD); |
donghuoyinzi | 0:17e9016529cf | 53 | DigitalOut know::pow(POW); //PA_8 |
donghuoyinzi | 0:17e9016529cf | 54 | DigitalOut know::reset(RESET); //PB_9 |
donghuoyinzi | 0:17e9016529cf | 55 | |
donghuoyinzi | 0:17e9016529cf | 56 | DigitalOut know::led1(LED1); //PB_0 |
donghuoyinzi | 0:17e9016529cf | 57 | DigitalOut know::led2(LED2); //PB_1 |
donghuoyinzi | 0:17e9016529cf | 58 | |
donghuoyinzi | 0:17e9016529cf | 59 | Ticker know::time1; //time1 |
donghuoyinzi | 0:17e9016529cf | 60 | Ticker know::time2; //time2 |
donghuoyinzi | 0:17e9016529cf | 61 | Ticker know::time3; //time3 |
donghuoyinzi | 0:17e9016529cf | 62 | |
donghuoyinzi | 0:17e9016529cf | 63 | /***************************************** |
donghuoyinzi | 0:17e9016529cf | 64 | Fun.: 填写任务表 |
donghuoyinzi | 0:17e9016529cf | 65 | Desc.: |
donghuoyinzi | 0:17e9016529cf | 66 | Auth.&Vesion:2017.7.2 |
donghuoyinzi | 0:17e9016529cf | 67 | *****************************************/ |
donghuoyinzi | 0:17e9016529cf | 68 | void knowAct::buildtsk (void) |
donghuoyinzi | 0:17e9016529cf | 69 | { |
donghuoyinzi | 0:17e9016529cf | 70 | //读数据 |
donghuoyinzi | 0:17e9016529cf | 71 | //填写task[],taskdat[] |
donghuoyinzi | 0:17e9016529cf | 72 | } |
donghuoyinzi | 0:17e9016529cf | 73 | |
donghuoyinzi | 0:17e9016529cf | 74 |