You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
905 B
C++

//
void Periodic_run(){
if(T_10ms){
read_analog(Values_AI, Size_AI);
read_mc9(Values_PV, Size_PV);
T_10ms = false;
}
if(T_20ms){
T_20ms = false;
}
if(T_50ms){
T_50ms = false;
}
if(T_100ms){
T_100ms = false;
}
if(T_200ms){
T_200ms = false;
}
if(T_500ms){
read_mc9_req("10");
T_500ms = false;
}
if(T_500ms_2){
read_mc9_req("11");
T_500ms_2 = false;
}
if(T_1000ms){
AnalogIn_Print();
T_1000ms = false;
}
}
void timer_10ms(){
msCnt += 10;
T_10ms = true;
if (msCnt % 20 == 0){
T_20ms = true;
}
if (msCnt % 50 == 0){
T_50ms = true;
}
if (msCnt % 100 == 0){
T_100ms = true;
}
if (msCnt % 200 == 0){
T_200ms = true;
}
if (msCnt % 500 == 0){
T_500ms = true;
}
if ((msCnt+250) % 500 == 0){
T_500ms_2 = true;
}
if (msCnt > 1000){
T_1000ms = true;
msCnt = 0;
}
}