yan zhang
/
NB_CLOCK_180505
clock
Revision 3:b8766d623f01, committed 2018-05-22
- Comitter:
- donghuoyinzi
- Date:
- Tue May 22 09:10:05 2018 +0000
- Parent:
- 2:e54d9d87c6cb
- Commit message:
- 0522
Changed in this revision
diff -r e54d9d87c6cb -r b8766d623f01 main.cpp --- a/main.cpp Mon May 14 00:04:42 2018 +0000 +++ b/main.cpp Tue May 22 09:10:05 2018 +0000 @@ -7,52 +7,51 @@ *******************************/ int main() { - tm *tim; - - string strx,stry, strz; - int n,f; + //tm *tim; + //string strx,stry, strz; + //int n,f; - f401Act::init(); //映射平台初始化 + //f401Act::init(); //映射平台初始化 maiAct::init_scorp(); //增强硬件初始化 - f401Act::put_rwdg(); //Refresh iwdg + //f401Act::put_rwdg(); //Refresh iwdg maiAct::init_dat(); //data initialization maiAct::init_star(); //start initialization - while(1){ - if(know::polSta[46]=="1"){ //state of tick2S - time_t seconds=time(NULL); - tim=localtime(&seconds); + while(1){ + if(know::polSta[46]=='1'){ //state of tick2S + //time_t seconds=time(NULL); + //tim=localtime(&seconds); - strx=know::task[0]; - stry=strx.substr(13,12); //提取时间,从索引13开始12个字符 + //strx=know::task[0]; + //stry=strx.substr(13,12); //提取时间,从索引13开始12个字符 //strz="yymmddhh"+to_string(tim->tm_min)+"ss"; - if(stry == strz){ //bc95动作 - know::polDat[1]= tim->tm_hour; - know::polDat[2]= tim->tm_min; - know::polDat[3]= tim->tm_sec; + //if(stry == strz){ //bc95动作 + //know::polDat[1]= tim->tm_hour; + //know::polDat[2]= tim->tm_min; + //know::polDat[3]= tim->tm_sec; bc95Act:: put(); - } - if(know::polSta[16]=="1"&& know::polSta[15]=="0") bc95Act::get_knw(); // puts, getknwS - if(know::polSta[15]=="1"&& know::polSta[18]=="0") bc95Act::setrtc(); // setrtcS私有 - if(know::polSta[18]=="1"&& know::polSta[0]=="0") knowAct::buildtsk(); // buildtskS + //} + if(know::polSta[16]=='1'&& know::polSta[15]=='0') bc95Act::get_knw(); // puts, getknwS + if(know::polSta[15]=='1'&& know::polSta[18]=='0') bc95Act::setrtc(); // setrtcS私有 + if(know::polSta[18]=='1'&& know::polSta[0]=='0') knowAct::buildtsk(); // buildtskS - n=0; - f=1; - while(f==1){ - n++; - strx=know::task[n]; - stry= strx.substr(13,12); //提取时间,从索引13开始12个字符 + //n=0; + //f=1; + //while(f==1){ + //n++; + //strx=know::task[n]; + //stry= strx.substr(13,12); //提取时间,从索引13开始12个字符 //strz= "yymmdd"+ to_string (tim->tm_hour)+to_string (tim->tm_min)+"ss"; - if(stry == strz){ - stry= strx. substr(12,2); //提取语音编号 + //if(stry == strz){ + //stry= strx. substr(12,2); //提取语音编号 //播放 - f=0; - } - } + //f=0; + //} + //} } //f401Act::sys_sleepy(); //cpu sleep } @@ -90,7 +89,7 @@ set_time(1514806505);//自1970年1月1日0时0分0秒到2018年1月1日11时35分05秒 f401Act::ready(); - //cloDAct::ready(); + cloDAct::ready(); cloSAct::ready(); }
diff -r e54d9d87c6cb -r b8766d623f01 main.h --- a/main.h Mon May 14 00:04:42 2018 +0000 +++ b/main.h Tue May 22 09:10:05 2018 +0000 @@ -18,8 +18,8 @@ static void init_star(void); // initialization of start static void init_ready(void); // initialization of ready - static void disp_act(string adresing); //非节拍任务响应 - static void disp_actj(string adresing); //非节拍任务响应 + //static void disp_act(string adresing); //非节拍任务响应 + //static void disp_actj(string adresing); //非节拍任务响应 static void judg_sleep(void); };
diff -r e54d9d87c6cb -r b8766d623f01 myKnow/myknow.cpp --- a/myKnow/myknow.cpp Mon May 14 00:04:42 2018 +0000 +++ b/myKnow/myknow.cpp Tue May 22 09:10:05 2018 +0000 @@ -10,26 +10,21 @@ */ //know::act[]={"n"}; //know::assgsta[]={"n"}; -string know::task[]={"n"}; -string know::taskdat[]={"n"}; +char know::task[20][TSK_MAX_LEN]={"n"}; +//char know::taskdat[10]={"n"}; -string know::polSta[100]={"0", +char know::polSta[100]={'0', //knbuildtsk-0 - "0","0","0","0", + '0','0','0','0','0','0','0','0', //4getpow-4,4rst-6,4slepy-7,4isrpc-8 - - "0","0","0","0","0","0", + '0','0','0','0','0','0','0','0','0','0','0', //b9gettim-14,b9getknw-15,b9put-16,bcgetISR-17,bcsetrtc-18,bcchangdate-19 - - "0","0","0","0","0","0","0","0", + '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0', //cdputsnorm-25,cdputmnorm-26,cdputmchas-27,cdputsstop-28,cdputmstop-29,cdcmpsec-32,cdcmpmin-33,cdcmpsmin-34 - "0","0","0","0","0"}; + '0','0','0','0','0','0','0','0','0','0','0','0','0'}; //csgetsec-40,csgetmin-41,csputopen-42,csisrsyst2-46,csisrsyst3-47 - - - - -string know::polDat[20]= {"n","n", + +char know::polDat[10][DAT_MAX_LEN]= {"n","n", //401get-0,401put-1 "n","n", //b9get-2,b9put-3
diff -r e54d9d87c6cb -r b8766d623f01 myKnow/myknow.h --- a/myKnow/myknow.h Mon May 14 00:04:42 2018 +0000 +++ b/myKnow/myknow.h Tue May 22 09:10:05 2018 +0000 @@ -1,15 +1,17 @@ #include "mbed.h" -#include "string" #ifndef know_H #define know_H + #define TSK_MAX_LEN 50 + #define DAT_MAX_LEN 50 + #define UART1_TX PA_9 //MCU TX1 #define UART1_RX PA_10 //MCU RX1 #define UART2_TX PA_2 //MCU TX2 #define UART2_RX PA_3 //MCU RX2 - #define UART3_TX PB_10 //BC95 RX - #define UART3_RX PB_11 //BC95 TX + #define UART3_TX PB_10 //BC95 RXPA_11 + #define UART3_RX PB_11 //BC95 TXPA_12 #define SECOND_T0 PB_13 //输出驱动马达-秒针 #define SECOND_T1 PB_12 //输出驱动马达-秒针 @@ -30,14 +32,9 @@ class know { public: - static string task[]; //任务编址 - static string taskdat[]; // - //static string act[]; //act编址 - //static string assgsta[] //数据变量分配编址 - - static string polSta[100]; //状态池 - - static string polDat[20]; //数据池 + static char task[20][TSK_MAX_LEN]; //任务编址 + static char polSta[100]; //状态池 + static char polDat[10][DAT_MAX_LEN]; //数据池 static Serial uart1; static Serial uart2;
diff -r e54d9d87c6cb -r b8766d623f01 myMapPlat/myf401.cpp --- a/myMapPlat/myf401.cpp Mon May 14 00:04:42 2018 +0000 +++ b/myMapPlat/myf401.cpp Tue May 22 09:10:05 2018 +0000 @@ -1,7 +1,7 @@ #include "myf401.h" -IWDG_HandleTypeDef f401Act::hiwdg; //iwdg instance -TIM_HandleTypeDef htim2; +//IWDG_HandleTypeDef f401Act::hiwdg; //iwdg instance +//TIM_HandleTypeDef htim2; int f401Act::bufpow=0; char f401Act::bufR[10]={0x00}; char f401Act::bufT[10]={0x00}; @@ -11,7 +11,7 @@ Fun.: f401pc initializations,include iwdg\system tick\key interrupt。 Desc.: 含低功耗,使用内部低功耗振荡器,频率1.048MHz,仅启用PB口Sleep模式115uA,启用PA、PB口Sleep模式131uA Auth. Vesion:2017.7.2 -*******************************/ +****************************** void f401Act::init(void) { HAL_Init(); //HAL库初始化 @@ -22,9 +22,9 @@ MY_GPIO_Config(); //专属IO初始化配置 init_wdg(); -} +}*/ -/** 系统时钟配置函数 **/ +/** 系统时钟配置函数 * void f401Act::SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct; @@ -33,10 +33,10 @@ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); //Configure the main internal regulator output voltage - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; //Initializes the CPU, AHB and APB busses clocks,使用内部低功耗振荡器 - RCC_OscInitStruct.MSIState = RCC_MSI_ON; - RCC_OscInitStruct.MSICalibrationValue = 0; - RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_4; //配置振荡器频率为1.048MHz +//RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; //Initializes the CPU, AHB and APB busses clocks,使用内部低功耗振荡器 +//RCC_OscInitStruct.MSIState = RCC_MSI_ON; +//RCC_OscInitStruct.MSICalibrationValue = 0; +//RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_4; //配置振荡器频率为1.048MHz RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { @@ -45,7 +45,7 @@ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK //Initializes the CPU, AHB and APB busses clocks |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI; +//RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; @@ -61,9 +61,9 @@ HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); //SysTick_IRQn interrupt configuration } - +*/ -/** IO初始化配置函数 **/ +/** IO初始化配置函数 * void f401Act::MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct; @@ -96,9 +96,9 @@ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); } - +*/ /** IO定制化配置函数-基本IO初始电平设置 -根据实际使用的功能进行配置,原则是不用或者空闲的引脚,上拉的置高,下拉的置低。**/ +根据实际使用的功能进行配置,原则是不用或者空闲的引脚,上拉的置高,下拉的置低。* void f401Act::MY_GPIO_Config(void) { @@ -110,16 +110,16 @@ HAL_GPIO_WritePin(GPIOA,GPIO_PIN_All,GPIO_PIN_SET); //大部分使用的IO都是上拉,先全部配置为高,再去配置其他特殊引脚。 HAL_GPIO_WritePin(GPIOA,GPIO_PIN_14,GPIO_PIN_RESET); //10K下拉,低功耗需要配置为低,否则消耗180uA。 -} +}*/ -/**** initializations of watchdog*********/ +/**** initializations of watchdog******** void f401Act::init_wdg (void) { hiwdg.Instance=IWDG; hiwdg.Init.Prescaler=IWDG_PRESCALER_16; //分频因子[4,8,16,32,64,128,256,256] 对应400ms/800ms/1600ms/3200ms/6400ms/12800ms/25600ms hiwdg.Init.Reload=4095; //递减计数0~0XFFF HAL_IWDG_Init(&hiwdg); -} +}*/ /***************************************** Fun.: pc ready。 @@ -168,7 +168,7 @@ Fun.: cpu sleep。 Desc.: Auth. Vesion:2017.7.2 -*****************************************/ +**************************************** void f401Act::put_slepy(void) { __HAL_RCC_GPIOA_CLK_DISABLE(); //关闭引脚时钟 @@ -182,18 +182,18 @@ //HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI); //SLEEP //HAL_PWR_EnterSTANDBYMode(); //STABDBY //HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI); //STOP -} +}*/ /***************************************** Fun.: reflesh iwdg。 Desc.: Auth. Vesion:2017.7.2 -*****************************************/ +**************************************** void f401Act:: put_rwdg(void) { HAL_IWDG_Refresh(&hiwdg); //reflesh iwdg } - +*/ /***************************************** Fun.: pc getc ISR。 Desc.:
diff -r e54d9d87c6cb -r b8766d623f01 myMapPlat/myf401.h --- a/myMapPlat/myf401.h Mon May 14 00:04:42 2018 +0000 +++ b/myMapPlat/myf401.h Tue May 22 09:10:05 2018 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" -#include "string" #include "myknow.h" #ifndef myf401_H @@ -13,18 +12,18 @@ static char revoke(void); static void get_pow(void); - static void put_rwdg(void); + //static void put_rwdg(void); static void put_rst(void); - static void put_slepy(void); + //static void put_slepy(void); private: - static IWDG_HandleTypeDef hiwdg; + //static IWDG_HandleTypeDef hiwdg; - static void SystemClock_Config(void); - static void MX_GPIO_Init(void); - static void MY_GPIO_Config(void); + //static void SystemClock_Config(void); + //static void MX_GPIO_Init(void); + //static void MY_GPIO_Config(void); - static void init_wdg(void); + //static void init_wdg(void); static void isr_pc(void); //get interrupt buffer static int cnt;
diff -r e54d9d87c6cb -r b8766d623f01 myScope/mybc95.cpp --- a/myScope/mybc95.cpp Mon May 14 00:04:42 2018 +0000 +++ b/myScope/mybc95.cpp Tue May 22 09:10:05 2018 +0000 @@ -104,13 +104,13 @@ } if(bc95Act::stpSe==2) CheckOK(200,1,10); //10是最大的查询次数 if(bc95Act::stpSe==250){ //规范250是失败 - know::polSta[15]="2"; + know::polSta[15]='2'; bc95Act::stpSe=0; } if(bc95Act::stpSe==200){ //规范200是成功, bc95Act::stpSe=0; //know::magtsk(); - know::polSta[15]="1"; + know::polSta[15]='1'; } return; } @@ -192,8 +192,8 @@ void bc95Act::CheckOK(int Nexstp,int Lastp,int maxstp) { - if(know::polSta[17]=="1"){ - know::polSta[17]="0"; + if(know::polSta[17]=='1'){ + know::polSta[17]='0'; bc95Act::stpSe=Nexstp; bc95Act::cntlink=0; } @@ -208,7 +208,7 @@ { know::uart3.printf("AT+NSOCR=DGRAM,17,9090,1\r\n"); wait_ms(50); - know::uart3.printf("%s",know::polDat[2].c_str()); + know::uart3.printf("%s",know::polDat[2]); wait_ms(50); know::uart3.printf("AT+NSOCL=0\r\n"); wait_ms(50); @@ -224,7 +224,7 @@ void bc95Act::getISR(void) { char buf; - + buf=know::uart3.getc(); bc95Act::buf[cnt]=buf; cnt++;
diff -r e54d9d87c6cb -r b8766d623f01 myScope/mybc95.h --- a/myScope/mybc95.h Mon May 14 00:04:42 2018 +0000 +++ b/myScope/mybc95.h Tue May 22 09:10:05 2018 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" -#include "string" #include "myf401.h" #include "myknow.h"
diff -r e54d9d87c6cb -r b8766d623f01 myScope/myclodriv.cpp --- a/myScope/myclodriv.cpp Mon May 14 00:04:42 2018 +0000 +++ b/myScope/myclodriv.cpp Tue May 22 09:10:05 2018 +0000 @@ -36,10 +36,10 @@ spstpSe=0; mcstpSe=0; - know::polSta[26]="0"; - know::polSta[33]="0"; - know::polSta[32]="0"; - know::polSta[34]="0"; + know::polSta[26]='0'; + know::polSta[33]='0'; + know::polSta[32]='0'; + know::polSta[34]='0'; sec=0; min=0; @@ -116,7 +116,7 @@ { mnstpSe++; if(mnstpSe<=2){ //高电平脉冲宽度31.250ms/15.625ms=2 - switch(atoi(know::polSta[26].c_str())){ //周期交替标志 + switch(know::polSta[26]-'0'){ //周期交替标志 case 1: know::MotM1 = 1; //分针马达端1输出高电平 know::MotM0 = 0; //分针马达端0输出低电平 @@ -132,12 +132,12 @@ else if(mnstpSe<=639&&mnstpSe>=3){ know::MotM0 = 0; //分针马达端0输出低电平 know::MotM1 = 0; //分针马达端1输出低电平 - switch(atoi(know::polSta[26].c_str())){ + switch(know::polSta[26]-'0'){ case 0: - know::polSta[26]="1"; //马达端1输出脉冲标识置1 + know::polSta[26]='1'; //马达端1输出脉冲标识置1 break; case 1: - know::polSta[26]="0"; + know::polSta[26]='0'; break; default: break; @@ -177,8 +177,8 @@ know::MotM1 = 0; //分针马达端1输出低电平 mcstpSe=0; cmp_cmin(); - if(know::polSta[33]=="1"){ - know::polSta[27]="1"; + if(know::polSta[33]=='1'){ + know::polSta[27]='1'; know::time1.attach_us(&cloSAct::isr_systick1,15625); } break; @@ -208,7 +208,7 @@ if(tim->tm_min== min&&tim->tm_hour== hour){ min=54; //分针检测信号有效为11时59分 开始追针或等追 hour=11; - know::polSta[33]="1"; + know::polSta[33]='1'; } } @@ -228,9 +228,9 @@ break; case 17: cmp_sec(); - if(atoi(know::polSta[32].c_str())==1){ + if((know::polSta[32]-'0')==1){ spstpSe=0; - know::polSta[28]="1"; //cmpsec_state="k"; + know::polSta[28]='1'; //cmpsec_state="k"; } else spstpSe=16; break; @@ -244,7 +244,7 @@ tm *tim; time_t seconds=time(NULL); tim=localtime(&seconds); - if(tim->tm_sec==56) know::polSta[32]="1"; //秒针检测信号有效为56秒 等追 + if(tim->tm_sec==56) know::polSta[32]='1'; //秒针检测信号有效为56秒 等追 } /***************************** @@ -257,8 +257,8 @@ know::MotM0 = 0; //Mot1分针驱动引脚输出低电平 know::MotM1 = 0; cmp_smin(); - if(atoi(know::polSta[34].c_str())==1){ - know::polSta[29]="1"; //正常走时停止则为59分 + if((know::polSta[34]-'0')==1){ + know::polSta[29]='1'; //正常走时停止则为59分 know::time1.attach_us(&cloSAct::isr_systick1,15625); } } @@ -268,6 +268,6 @@ tm *tim; time_t seconds=time(NULL); tim=localtime(&seconds); - if(tim->tm_min==59) know::polSta[34]="1"; //待测 若追针后停止分针则为58分 pol_min=58 + if(tim->tm_min==59) know::polSta[34]='1'; //待测 若追针后停止分针则为58分 pol_min=58 }
diff -r e54d9d87c6cb -r b8766d623f01 myScope/myclosenr.cpp --- a/myScope/myclosenr.cpp Mon May 14 00:04:42 2018 +0000 +++ b/myScope/myclosenr.cpp Tue May 22 09:10:05 2018 +0000 @@ -71,21 +71,21 @@ if(tim->tm_hour==11&&tim->tm_min==45){ know::TestO_S=0; know::TestO_M=1; //分针检测输出引脚置 - know::polSta[42]="2"; //putopenS + know::polSta[42]='2'; //putopenS } else if(tim->tm_sec==50&&(tim->tm_min==15|| tim->tm_min ==25||tim->tm_min ==35)){ know::TestO_M=0; know::TestO_S=1; //秒针检测输出引脚置高 - know::polSta[42]="3"; //putopenS + know::polSta[42]='3'; //putopenS } if(tim->tm_sec==10) { //关闭秒光耦 know::TestO_S=0; - know::polSta[42]="0"; + know::polSta[42]='0'; } if(tim->tm_min==10){ //关闭分光耦 know::TestO_M=0; - know::polSta[42]="0"; + know::polSta[42]='0'; } } @@ -121,8 +121,8 @@ time_t seconds=time(NULL); tim=localtime(&seconds); - if(tim->tm_sec!=56) know::polSta[40]="1"; //getsecS - else know::polSta[40]="2"; //getsecS return =55正常 + if(tim->tm_sec!=56) know::polSta[40]='1'; //getsecS + else know::polSta[40]='2'; //getsecS return =55正常 } /***************************** @@ -156,9 +156,9 @@ tim->tm_hour=tim->tm_hour%12; - if(tim->tm_hour==11&&tim->tm_min==54) know::polSta[41]="2"; //getminS 正常 - else if(tim->tm_hour==11&&tim->tm_min<54&&tim->tm_min>=49) know::polSta[41]="1"; //getminS; 停 - else know::polSta[41]="3"; //getminS 追 + if(tim->tm_hour==11&&tim->tm_min==54) know::polSta[41]='2'; //getminS 正常 + else if(tim->tm_hour==11&&tim->tm_min<54&&tim->tm_min>=49) know::polSta[41]='1'; //getminS; 停 + else know::polSta[41]='3'; //getminS 追 } /***************************** @@ -181,33 +181,31 @@ { put_open(); //判断是否开/关秒、分光耦 - if(know::polSta[42]=="2"&&know::polSta[47]=="0") know::time3.attach_us(&isr_systick3,15625); //putsecS,定时器3打开,运行其中的秒检测 + if(know::polSta[42]=='2'&&know::polSta[47]=='0') know::time3.attach_us(&isr_systick3,15625); //putsecS,定时器3打开,运行其中的秒检测 - if(know::polSta[42]=="3") { //检测分 + if(know::polSta[42]=='3') { //检测分 get_min(); - if(know::polSta[41]=="1"||know::polSta[41]=="3") { //getminS + if(know::polSta[41]=='1'||know::polSta[41]=='3') { //getminS know::time1.attach_us(0,15625); //停或者追都关闭定时器1 - if(know::polSta[41]=="3"&&know::polSta[47]=="0") know::time3.attach_us(&isr_systick3,15625); //打开定时器3,运行其中的分追 - if(know::polSta[41]=="1"&&know::polSta[29]=="0") { //put mstop S + if(know::polSta[41]=='3'&&know::polSta[47]=='0') know::time3.attach_us(&isr_systick3,15625); //打开定时器3,运行其中的分追 + if(know::polSta[41]=='1'&&know::polSta[29]=='0') { //put mstop S cloDAct::put_mstop(); - if(know::polSta[29]=="1") { //停分针结束 - know::polSta[29]="0"; //状态复位 - know::polSta[41]="0"; - know::polSta[42]="0"; + if(know::polSta[29]=='1') { //停分针结束 + know::polSta[29]='0'; //状态复位 + know::polSta[41]='0'; + know::polSta[42]='0'; know::time1.attach_us(&isr_systick1,15625); know::time3.attach_us(0,15625); //任务互斥,关闭定时器3 - know::polSta[47]="0"; + know::polSta[47]='0'; } } } } - //know::polSta[15]="1"; //state of step ??? - tick2cnt++; if(tick2cnt>=20) { tick2cnt=0; - know::polSta[46]="1"; //state of tick2S + know::polSta[46]='1'; //state of tick2S } if(tick2cnt>=40) tick2cnt=0; @@ -220,30 +218,30 @@ *****************************/ void cloSAct::isr_systick3(void) { - know::polSta[47]="1"; + know::polSta[47]='1'; - if(know::polSta[42]=="1"&& know::polSta[40]=="0") get_sec(); //putsecS,getsecS + if(know::polSta[42]=='1'&& know::polSta[40]=='0') get_sec(); //putsecS,getsecS - if(know::polSta[40]=="1"&& know::polSta[28]=="0"){ //getsecS, putsstopS + if(know::polSta[40]=='1'&& know::polSta[28]=='0'){ //getsecS, putsstopS know::time1.attach_us(0,15625); cloDAct::put_sstop(); //停止秒针 - if(know::polSta[28]=="1"){ //校秒结束 - know::polSta[28]="0"; //状态复位 - know::polSta[40]="0"; - know::polSta[42]="0"; - know::polSta[47]="0"; + if(know::polSta[28]=='1'){ //校秒结束 + know::polSta[28]='0'; //状态复位 + know::polSta[40]='0'; + know::polSta[42]='0'; + know::polSta[47]='0'; know::time1.attach_us(&isr_systick1,15625); know::time3.attach_us(0,15625); } } - if(know::polSta[41]=="3"&&know::polSta[27]=="0"){ // getminS, putmchasS分针追针 + if(know::polSta[41]=='3'&&know::polSta[27]=='0'){ // getminS, putmchasS分针追针 cloDAct::put_mchas(); - if(know::polSta[27]=="1"){ //追分完成 - know::polSta[27]="0"; //状态复位 - know::polSta[41]="0"; - know::polSta[42]="0"; - know::polSta[47]="0"; + if(know::polSta[27]=='1'){ //追分完成 + know::polSta[27]='0'; //状态复位 + know::polSta[41]='0'; + know::polSta[42]='0'; + know::polSta[47]='0'; know::time1.attach_us(&isr_systick1,15625); know::time3.attach_us(0,15625); }
diff -r e54d9d87c6cb -r b8766d623f01 myScope/myclosenr.h --- a/myScope/myclosenr.h Mon May 14 00:04:42 2018 +0000 +++ b/myScope/myclosenr.h Tue May 22 09:10:05 2018 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" -//#include "string" #include "myf401.h" #include "myknow.h"