From 00c38480869692fe53185a4666d3baa9388fe41e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 10 Jul 2022 08:02:56 -0400 Subject: [PATCH] Update cubesatsim.ino --- cubesatsim/cubesatsim.ino | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cubesatsim/cubesatsim.ino b/cubesatsim/cubesatsim.ino index 42815b97..61857151 100644 --- a/cubesatsim/cubesatsim.ino +++ b/cubesatsim/cubesatsim.ino @@ -2365,19 +2365,21 @@ void setup1() { void loop1() { - if (mode == FSK) + if (mode == FSK) { tx_bit = (buffer[wav_position] > 0) ? HIGH: LOW; digitalWrite(AUDIO_OUT_PIN, tx_bit); - } else if (mode == BPSK) { + } + else if (mode == BPSK) { tx_bit = (buffer[wav_position] > 0) ? true: false; pwm_config_set_output_polarity( &config, tx_bit, tx_bit); pwm_init(bpsk_pin_slice, &config, true); pwm_set_gpio_level(BPSK_PWM_PIN, (config.top + 1) * 0.5); } + // if (wav_position++ > BUFFER_SIZE) { // 300) { // wav_position = wav_position - BUFFER_SIZE; if (wav_position++ > bufLen) { // 300) { @@ -2386,8 +2388,8 @@ void loop1() { Serial.print(" "); Serial.println(millis()); } -// delay(5); //2 1); - sleep(delay_ms_time); + delay(1); //2 1); +// sleep(delay_ms_time); // check pushbutton // int pb_value;