move Pi Zero detect code to config_gpio

pico-v0.36-detect-pi
alanbjohnston 3 years ago committed by GitHub
parent 4f12636244
commit b49fe72090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -116,19 +116,19 @@ void setup() {
// if Pi is present, run Payload OK software // if Pi is present, run Payload OK software
/// load_files(); /// load_files();
/**/ /*
pinMode(PI_3V3_PIN, INPUT); pinMode(PI_3V3_PIN, INPUT);
Serial.print("Pi 3.3V: "); Serial.print("Pi 3.3V: ");
Serial.println(digitalRead(PI_3V3_PIN)); Serial.println(digitalRead(PI_3V3_PIN));
// if (digitalRead(PI_3V3_PIN) == HIGH) { if (digitalRead(PI_3V3_PIN) == HIGH) {
{ // {
Serial.print("Pi Zero present, so running Payload OK code instead of CubeSatSim code."); Serial.print("Pi Zero present, so running Payload OK code instead of CubeSatSim code.");
start_payload(); start_payload();
while(true) { while(true) {
// payload_OK_only(); // payload_OK_only();
} }
} }
/**/ */
// configure STEM Payload sensors // configure STEM Payload sensors
// pinMode(PI_3V3_PIN, OUTPUT); // pinMode(PI_3V3_PIN, OUTPUT);
@ -3609,6 +3609,19 @@ void config_gpio() {
for (int i = 6; i < 29; i++) { for (int i = 6; i < 29; i++) {
pinMode(i, INPUT); pinMode(i, INPUT);
} }
pinMode(PI_3V3_PIN, INPUT);
Serial.print("Pi 3.3V: ");
Serial.println(digitalRead(PI_3V3_PIN));
// if (digitalRead(PI_3V3_PIN) == HIGH) {
{
Serial.print("Pi Zero present, so running Payload OK code instead of CubeSatSim code.");
start_payload();
while(true) {
// payload_OK_only();
}
}
// set audio out to TXC board // set audio out to TXC board
pinMode(AUDIO_OUT_PIN, OUTPUT); pinMode(AUDIO_OUT_PIN, OUTPUT);

Loading…
Cancel
Save

Powered by TurnKey Linux.