|
@@ -69,18 +69,18 @@ void cc1200_gpio_init(void)
|
|
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
.intr_type = GPIO_INTR_DISABLE
|
|
.intr_type = GPIO_INTR_DISABLE
|
|
};
|
|
};
|
|
- gpio_config_t debug_pin_config =
|
|
|
|
- {
|
|
|
|
- .pin_bit_mask = (uint64_t) (BIT64(DEBUG_0)|BIT64(DEBUG_1)),
|
|
|
|
- .mode = GPIO_MODE_OUTPUT,
|
|
|
|
- .pull_up_en = GPIO_PULLUP_DISABLE,
|
|
|
|
- .pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
|
|
- .intr_type = GPIO_INTR_DISABLE
|
|
|
|
- };
|
|
|
|
|
|
+// gpio_config_t debug_pin_config =
|
|
|
|
+// {
|
|
|
|
+// .pin_bit_mask = (uint64_t) (BIT64(DEBUG_0)|BIT64(DEBUG_1)),
|
|
|
|
+// .mode = GPIO_MODE_OUTPUT,
|
|
|
|
+// .pull_up_en = GPIO_PULLUP_DISABLE,
|
|
|
|
+// .pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
|
|
+// .intr_type = GPIO_INTR_DISABLE
|
|
|
|
+// };
|
|
|
|
|
|
gpio_config(&reset_pin_config);
|
|
gpio_config(&reset_pin_config);
|
|
gpio_config(&gpio_pin_config);
|
|
gpio_config(&gpio_pin_config);
|
|
- gpio_config(&debug_pin_config);
|
|
|
|
|
|
+ //gpio_config(&debug_pin_config);
|
|
|
|
|
|
|
|
|
|
gpio_set_level(CC1120_RESET, 1);
|
|
gpio_set_level(CC1120_RESET, 1);
|
|
@@ -369,7 +369,7 @@ static void IRAM_ATTR cc1200_aprs_tx_isr(void* arg)
|
|
new_sample = 1;
|
|
new_sample = 1;
|
|
|
|
|
|
toggle = toggle ^ 1;
|
|
toggle = toggle ^ 1;
|
|
- gpio_set_level(DEBUG_1, toggle);
|
|
|
|
|
|
+ //gpio_set_level(DEBUG_1, toggle);
|
|
}
|
|
}
|
|
|
|
|
|
void cc1200_lut_init(void)
|
|
void cc1200_lut_init(void)
|
|
@@ -398,12 +398,12 @@ void IRAM_ATTR cc1200_radio_APRSTXPacket(uint8_t *f, uint16_t f_len, uint8_t tx
|
|
gpio_set_intr_type(CC1120_GPIO3, GPIO_INTR_POSEDGE);
|
|
gpio_set_intr_type(CC1120_GPIO3, GPIO_INTR_POSEDGE);
|
|
|
|
|
|
// acquire SPI bus for fastest possible SPI transactions
|
|
// acquire SPI bus for fastest possible SPI transactions
|
|
- //spi_device_acquire_bus(spi, portMAX_DELAY);
|
|
|
|
|
|
+ spi_device_acquire_bus(spi, portMAX_DELAY);
|
|
|
|
|
|
|
|
|
|
int16_t i,j;
|
|
int16_t i,j;
|
|
uint16_t p_len = tx_delay * 12;
|
|
uint16_t p_len = tx_delay * 12;
|
|
- uint16_t t_len = tx_tail * 12;
|
|
|
|
|
|
+ uint16_t t_len = tx_tail * 12 + 1;
|
|
|
|
|
|
// Start CW transmission
|
|
// Start CW transmission
|
|
cc1200_spi_write_byte(CC120X_FIFO, 0x12);
|
|
cc1200_spi_write_byte(CC120X_FIFO, 0x12);
|
|
@@ -477,7 +477,7 @@ void IRAM_ATTR cc1200_radio_APRSTXPacket(uint8_t *f, uint16_t f_len, uint8_t tx
|
|
}
|
|
}
|
|
}
|
|
}
|
|
toggle2 = toggle2 ^ 1;
|
|
toggle2 = toggle2 ^ 1;
|
|
- gpio_set_level(DEBUG_0, toggle2);
|
|
|
|
|
|
+ //gpio_set_level(DEBUG_0, toggle2);
|
|
sample_count = 0;
|
|
sample_count = 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -505,7 +505,7 @@ void IRAM_ATTR cc1200_radio_APRSTXPacket(uint8_t *f, uint16_t f_len, uint8_t tx
|
|
}
|
|
}
|
|
}
|
|
}
|
|
toggle2 = toggle2 ^ 1;
|
|
toggle2 = toggle2 ^ 1;
|
|
- gpio_set_level(DEBUG_0, toggle2);
|
|
|
|
|
|
+ //gpio_set_level(DEBUG_0, toggle2);
|
|
sample_count = 0;
|
|
sample_count = 0;
|
|
//printf("Symbol: %x\n", aprs_flags.cur_bit);
|
|
//printf("Symbol: %x\n", aprs_flags.cur_bit);
|
|
}
|
|
}
|
|
@@ -550,6 +550,7 @@ void IRAM_ATTR cc1200_radio_APRSTXPacket(uint8_t *f, uint16_t f_len, uint8_t tx
|
|
}
|
|
}
|
|
cc1200_spi_strobe(CC120X_SIDLE);
|
|
cc1200_spi_strobe(CC120X_SIDLE);
|
|
spi_device_release_bus(spi);
|
|
spi_device_release_bus(spi);
|
|
|
|
+ gpio_uninstall_isr_service();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -562,7 +563,7 @@ static void IRAM_ATTR cc1200_aprs_rx_isr(void* arg)
|
|
cc1200_spi_read_byte(CC120X_CFM_RX_DATA_OUT, &data);
|
|
cc1200_spi_read_byte(CC120X_CFM_RX_DATA_OUT, &data);
|
|
|
|
|
|
toggle = toggle ^ 1;
|
|
toggle = toggle ^ 1;
|
|
- gpio_set_level(DEBUG_1, toggle);
|
|
|
|
|
|
+ //gpio_set_level(DEBUG_1, toggle);
|
|
xRingbufferSendFromISR(cfm_buf_handle, &data, sizeof(data), NULL);
|
|
xRingbufferSendFromISR(cfm_buf_handle, &data, sizeof(data), NULL);
|
|
//ets_write_char_uart(data);
|
|
//ets_write_char_uart(data);
|
|
//new_sample = 1;
|
|
//new_sample = 1;
|