added MAX and MIN

pull/74/head
alanbjohnston 5 years ago committed by GitHub
parent 68eb69776e
commit 2b0e96c256
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1380,10 +1380,10 @@ if (sim_mode)
printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]); printf("Vmin %f Vmax %f Imin %f Imax %f \n", voltage_min[count1], voltage_max[count1], current_min[count1], current_max[count1]);
} }
if (loop % 4 == 0) if (loop % 8 == 0)
{ {
printf("Sending MIN frame \n"); printf("Sending MIN frame \n");
frm_type = 0x02; frm_type = 0x03;
for (count1 = 0; count1 < 17; count1++) for (count1 = 0; count1 < 17; count1++)
{ {
if (count1 < 3) if (count1 < 3)
@ -1396,6 +1396,22 @@ if (sim_mode)
sensor[count1] = sensor_min[count1]; sensor[count1] = sensor_min[count1];
} }
} }
if ((loop + 4) % 8 == 0)
{
printf("Sending MAX frame \n");
frm_type = 0x02;
for (count1 = 0; count1 < 17; count1++)
{
if (count1 < 3)
other[count1] = other_max[count1];
if (count1 < 8)
{
voltage[count1] = voltage_max[count1];
current[count1] = current_max[count1];
}
sensor[count1] = sensor_max[count1];
}
}
memset(rs_frame,0,sizeof(rs_frame)); memset(rs_frame,0,sizeof(rs_frame));
memset(parities,0,sizeof(parities)); memset(parities,0,sizeof(parities));

Loading…
Cancel
Save

Powered by TurnKey Linux.