Skip to content

Commit 9733b0a

Browse files
Merge pull request #254 from alanbjohnston/pico-v0.35-i2c
add jpeg_decode conditional
2 parents 169b516 + f69dd73 commit 9733b0a

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

cubesatsim/cubesatsim.ino

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -265,36 +265,36 @@ void loop() {
265265
// char output_file2[] = "/cam2.bin";
266266
char output_file[] = "/cam.bin";
267267
// jpeg_decode(image_file, output_file, true); // debug_mode);
268-
jpeg_decode(input_file, output_file, false); // debug_mode);
269-
show_dir();
270-
// char telem_display[] = " BATT: STATUS: TEMP: ";
271-
272-
digitalWrite(PTT_PIN, HIGH); // shouldn't need this but
273-
// rotate_image(output_file2, output_file, telem_display);
274-
// show_dir();
275-
276-
if (debug_mode)
277-
Serial.println("Start transmit!!!");
278-
digitalWrite(PTT_PIN, LOW); // start transmit
279-
transmit_led(HIGH);
280-
281-
picosstvpp();
282-
283-
// scottie1_transmit_file(output_file, debug_mode);
284-
285-
// ITimer1.stopTimer(); // turn off pushbutton timer
286-
/// ITimer1.disableTimer(); // turn off pushbutton timer
287-
// play_pwm_file(26);
288-
// ITimer1.restartTimer(); // turn back on pushbutton timer
289-
/// ITimer1.enableTimer(); // turn back on pushbutton timer
290-
if (debug_mode)
291-
Serial.println("Stop transmit!");
292-
digitalWrite(PTT_PIN, HIGH); // stop transmit
293-
transmit_led(LOW);
294-
295-
if (debug_mode)
296-
Serial.println("\nImage sent!");
297-
268+
if (jpeg_decode(input_file, output_file, false)) { // only transmit if jpeg decode successful
269+
show_dir();
270+
// char telem_display[] = " BATT: STATUS: TEMP: ";
271+
272+
digitalWrite(PTT_PIN, HIGH); // shouldn't need this but
273+
// rotate_image(output_file2, output_file, telem_display);
274+
// show_dir();
275+
276+
if (debug_mode)
277+
Serial.println("Start transmit!!!");
278+
digitalWrite(PTT_PIN, LOW); // start transmit
279+
transmit_led(HIGH);
280+
281+
picosstvpp();
282+
283+
// scottie1_transmit_file(output_file, debug_mode);
284+
285+
// ITimer1.stopTimer(); // turn off pushbutton timer
286+
/// ITimer1.disableTimer(); // turn off pushbutton timer
287+
// play_pwm_file(26);
288+
// ITimer1.restartTimer(); // turn back on pushbutton timer
289+
/// ITimer1.enableTimer(); // turn back on pushbutton timer
290+
if (debug_mode)
291+
Serial.println("Stop transmit!");
292+
digitalWrite(PTT_PIN, HIGH); // stop transmit
293+
transmit_led(LOW);
294+
295+
if (debug_mode)
296+
Serial.println("\nImage sent!");
297+
}
298298
}
299299
else
300300
Serial.println("Unknown mode!");

0 commit comments

Comments
 (0)