pull/207/head
alanbjohnston 3 years ago committed by GitHub
parent 959ecb98ae
commit 3654affdc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -90,6 +90,8 @@ void setup() {
config_gpio(); config_gpio();
start_clockgen();
EEPROM.begin(512); EEPROM.begin(512);
#ifndef ARDUINO_ARCH_RP2040 #ifndef ARDUINO_ARCH_RP2040
@ -147,7 +149,6 @@ void setup() {
start_isr(); start_isr();
// start_pwm(); // start_pwm();
start_clockgen();
/**/ /**/
Serial.println("Transmitting callsign"); Serial.println("Transmitting callsign");
@ -3446,22 +3447,22 @@ bool TimerHandler0(struct repeating_timer *t) {
// Serial.print("l1 "); // Serial.print("l1 ");
// Serial.print(wav_position); // Serial.print(wav_position);
// Serial.print(" "); // Serial.print(" ");
while ((micros() - micro_timer2) < 832) { } while ((micros() - micro_timer2) < 832) { }
busy_wait_at_least_cycles(51); // 300 ns busy_wait_at_least_cycles(51); // 300 ns
// if ((micros() - micro_timer2) > 834) // if ((micros() - micro_timer2) > 834)
// Serial.println(micros() - micro_timer2); // Serial.println(micros() - micro_timer2);
micro_timer2 = micros(); micro_timer2 = micros();
if (buffer[wav_position++] > 0) { if (buffer[wav_position++] > 0) {
// digitalWrite(BPSK_CONTROL_A, HIGH); // digitalWrite(BPSK_CONTROL_A, HIGH);
// delayMicroseconds(2); // delayMicroseconds(2);
// digitalWrite(BPSK_CONTROL_B, LOW); // digitalWrite(BPSK_CONTROL_B, LOW);
clockgen.enableOutputOnly(1); clockgen.enableOutputOnly(1);
} else { } else {
// digitalWrite(BPSK_CONTROL_B, HIGH); // digitalWrite(BPSK_CONTROL_B, HIGH);
// delayMicroseconds(2); // delayMicroseconds(2);
// digitalWrite(BPSK_CONTROL_A, LOW); // digitalWrite(BPSK_CONTROL_A, LOW);
clockgen.enableOutputOnly(0); clockgen.enableOutputOnly(0);
} }
/* /*
tx_bit = (buffer[wav_position] > 0) ? HIGH: LOW; tx_bit = (buffer[wav_position] > 0) ? HIGH: LOW;
@ -3480,12 +3481,12 @@ bool TimerHandler0(struct repeating_timer *t) {
pwm_init(bpsk_pin_slice, &config, true); pwm_init(bpsk_pin_slice, &config, true);
pwm_set_gpio_level(BPSK_PWM_PIN, (config.top + 1) * 0.5); pwm_set_gpio_level(BPSK_PWM_PIN, (config.top + 1) * 0.5);
*/ */
if (wav_position > bufLen) { // 300) { if (wav_position > bufLen) { // 300) {
wav_position = wav_position - bufLen; wav_position = wav_position - bufLen;
// Serial.print("\nR"); // Serial.print("\nR");
// Serial.print(" "); // Serial.print(" ");
// Serial.println(millis()); // Serial.println(millis());
/* /**/
if ((micros() - micro_timer)/bufLen > 835) { if ((micros() - micro_timer)/bufLen > 835) {
if (bufLen != 0) { if (bufLen != 0) {
Serial.print("R Microseconds: "); Serial.print("R Microseconds: ");
@ -3493,7 +3494,7 @@ bool TimerHandler0(struct repeating_timer *t) {
} }
} }
micro_timer = micros(); micro_timer = micros();
*/ /**/
} else { } else {
// Serial.print("R' Microseconds: "); // Serial.print("R' Microseconds: ");
// Serial.println(micros() - micro_timer2); // Serial.println(micros() - micro_timer2);

Loading…
Cancel
Save

Powered by TurnKey Linux.