Update cubesatsim.ino

pull/153/head
alanbjohnston 4 years ago committed by GitHub
parent 81d3344d08
commit 4f0db81306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -766,8 +766,8 @@ void get_tlm_fox() {
data = val & 1 << (bit - 1); data = val & 1 << (bit - 1);
// printf ("%d i: %d new frame %d data10[%d] = %x bit %d = %d \n", // printf ("%d i: %d new frame %d data10[%d] = %x bit %d = %d \n",
// ctr/SAMPLES, i, frames, symbol, val, bit, (data > 0) ); // ctr/SAMPLES, i, frames, symbol, val, bit, (data > 0) );
Serial.print(val, HEX); // Debugging print!!! Serial.print(data, BIN); // Debugging print!!!
Serial.print(" "); // Serial.print(" ");
if (mode == FSK) { if (mode == FSK) {
phase = ((data != 0) * 2) - 1; phase = ((data != 0) * 2) - 1;
// printf("Sending a %d\n", phase); // printf("Sending a %d\n", phase);
@ -785,7 +785,7 @@ void get_tlm_fox() {
} }
// Serial.println("BB"); // Serial.println("BB");
} }
Serial.println("CC"); // Serial.println("CC");
} }
Serial.println(" "); Serial.println(" ");
Serial.println("Returning"); Serial.println("Returning");
@ -2041,8 +2041,10 @@ void pwm_interrupt_handler() {
pwm_counter++; pwm_counter++;
if (pwm_counter > pwm_counter_max) { if (pwm_counter > pwm_counter_max) {
pwm_counter -= pwm_counter_max; pwm_counter -= pwm_counter_max;
if (random(0,2) == 1) // if (random(0,2) == 1)
pwm_rnd_bit *= (-1.0); // pwm_rnd_bit *= (-1.0);
pwm_rnd = (buffer[wave_position] > 0) ? 1 : 0;
if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) { if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) {
pwm_value = 128 + pwm_amplitude; pwm_value = 128 + pwm_amplitude;
@ -2054,5 +2056,7 @@ void pwm_interrupt_handler() {
} }
} }
pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value); pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value);
// wav_position++; if (wav_position++ > 950)
wave_position = 0;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.