added conditional for sleep and change of threshold

pi-zero-2
alanbjohnston 4 years ago committed by GitHub
parent 894d91db9c
commit 88041efa1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,10 +27,15 @@ int main(int argc, char * argv[]) {
const char testStr[] = "cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^1000//' | grep '902120'";
FILE *file_test = sopen(testStr); // see if Pi Zero 2
fgets(resbuffer, 1000, file_test);
fprintf(stderr, "test result: %s\n", resbuffer);
// fprintf(stderr, "test result: %s\n", resbuffer);
fclose(file_test);
sleep(5); // try sleep at start to help boot
if (resbuffer <> NULL)
{
sleep(5); // try sleep at start to help boot
voltageThreshold = 3.7;
printf("Pi Zero 2 detected");
}
printf("\n\nCubeSatSim v1.1 starting...\n\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.