Unused varibles, functions and parameters.
Signed-off-by: Keith Packard <keithp@keithp.com>
return ao_log_current_pos == ao_log_end_pos;
}
return ao_log_current_pos == ao_log_end_pos;
}
static __xdata struct ao_task ao_log_task;
static __xdata struct ao_task ao_log_task;
void
ao_log_list(void) __reentrant
void
ao_log_list(void) __reentrant
- __pdata uint16_t next_sensor, next_other;
+ __pdata uint16_t next_sensor;
* when starting up.
*/
ao_log_data_pos = ao_data_ring_next(ao_data_head);
* when starting up.
*/
ao_log_data_pos = ao_data_ring_next(ao_data_head);
- next_other = next_sensor = ao_data_ring[ao_log_data_pos].tick;
+ next_sensor = ao_data_ring[ao_log_data_pos].tick;
ao_log_state = ao_flight_startup;
for (;;) {
/* Write samples to EEPROM */
ao_log_state = ao_flight_startup;
for (;;) {
/* Write samples to EEPROM */
void
ao_wakeup(__xdata void *wchan)
{
void
ao_wakeup(__xdata void *wchan)
{
#endif
static __pdata uint16_t ao_telemetry_interval;
#endif
static __pdata uint16_t ao_telemetry_interval;
-static __pdata uint8_t ao_rdf = 0;
+static __pdata uint8_t ao_rdf = 0;
static __pdata uint16_t ao_rdf_time;
#endif
static __pdata uint16_t ao_rdf_time;
#endif
static uint8_t ao_radio_done; /* tx done interrupt received */
static uint8_t ao_radio_wake; /* sleep address for radio interrupts */
static uint8_t ao_radio_abort; /* radio operation should abort */
static uint8_t ao_radio_done; /* tx done interrupt received */
static uint8_t ao_radio_wake; /* sleep address for radio interrupts */
static uint8_t ao_radio_abort; /* radio operation should abort */
-static uint8_t ao_radio_mcu_wake; /* MARC status change */
-static uint8_t ao_radio_marcstate; /* Last read MARC state value */
/* Debugging commands */
#define CC115L_DEBUG 0
/* Debugging commands */
#define CC115L_DEBUG 0
ao_radio_reg_read(uint8_t addr)
{
uint8_t data[1];
ao_radio_reg_read(uint8_t addr)
{
uint8_t data[1];
data[0] = ((1 << CC115L_READ) |
(0 << CC115L_BURST) |
data[0] = ((1 << CC115L_READ) |
(0 << CC115L_BURST) |
ao_radio_reg_write(uint8_t addr, uint8_t value)
{
uint8_t data[2];
ao_radio_reg_write(uint8_t addr, uint8_t value)
{
uint8_t data[2];
trace_add(trace_write, addr, value, NULL);
data[0] = ((0 << CC115L_READ) |
trace_add(trace_write, addr, value, NULL);
data[0] = ((0 << CC115L_READ) |
static void
ao_radio_burst_read_start (uint16_t addr)
{
uint8_t data[1];
static void
ao_radio_burst_read_start (uint16_t addr)
{
uint8_t data[1];
data[0] = ((1 << CC115L_READ) |
(1 << CC115L_BURST) |
data[0] = ((1 << CC115L_READ) |
(1 << CC115L_BURST) |
return CC115L_FIFO_SIZE - (ao_radio_reg_read(CC115L_TXBYTES) & CC115L_TXBYTES_NUM_TX_BYTES_MASK);
}
return CC115L_FIFO_SIZE - (ao_radio_reg_read(CC115L_TXBYTES) & CC115L_TXBYTES_NUM_TX_BYTES_MASK);
}
static uint8_t
ao_radio_status(void)
{
return ao_radio_strobe (CC115L_SNOP);
}
static uint8_t
ao_radio_status(void)
{
return ao_radio_strobe (CC115L_SNOP);
}
#define ao_radio_rdf_value 0x55
#define ao_radio_rdf_value 0x55
static uint8_t
ao_radio_get_marcstate(void)
{
return ao_radio_reg_read(CC115L_MARCSTATE) & CC115L_MARCSTATE_MASK;
}
static uint8_t
ao_radio_get_marcstate(void)
{
return ao_radio_reg_read(CC115L_MARCSTATE) & CC115L_MARCSTATE_MASK;
}
static void
ao_radio_done_isr(void)
static void
ao_radio_done_isr(void)
ao_wakeup(&ao_radio_wake);
}
ao_wakeup(&ao_radio_wake);
}
-static void
-ao_radio_start_tx(void)
-{
-}
-
static void
ao_radio_idle(void)
{
static void
ao_radio_idle(void)
{
ao_radio_set_mode(uint16_t new_mode)
{
uint16_t changes;
ao_radio_set_mode(uint16_t new_mode)
{
uint16_t changes;
if (new_mode == ao_radio_mode)
return;
if (new_mode == ao_radio_mode)
return;
static void
ao_radio_setup(void)
{
static void
ao_radio_setup(void)
{
ao_radio_strobe(CC115L_SRES);
ao_delay(AO_MS_TO_TICKS(10));
ao_radio_strobe(CC115L_SRES);
ao_delay(AO_MS_TO_TICKS(10));
void
ao_radio_send(const void *d, uint8_t size)
{
void
ao_radio_send(const void *d, uint8_t size)
{
ao_radio_get();
ao_radio_send_len = ao_fec_encode(d, size, tx_data);
ao_radio_send_buf = tx_data;
ao_radio_get();
ao_radio_send_len = ao_fec_encode(d, size, tx_data);
ao_radio_send_buf = tx_data;
ao_radio_send(packet, sizeof (packet));
}
ao_radio_send(packet, sizeof (packet));
}
-#endif /* CC115L_DEBUG */
#if HAS_APRS
#include <ao_aprs.h>
#if HAS_APRS
#include <ao_aprs.h>
+#endif /* CC115L_DEBUG */
static const struct ao_cmds ao_radio_cmds[] = {
{ ao_radio_test_cmd, "C <1 start, 0 stop, none both>\0Radio carrier test" },
static const struct ao_cmds ao_radio_cmds[] = {
{ ao_radio_test_cmd, "C <1 start, 0 stop, none both>\0Radio carrier test" },
void
ao_radio_init(void)
{
void
ao_radio_init(void)
{
ao_radio_configured = 0;
ao_spi_init_cs (AO_CC115L_SPI_CS_PORT, (1 << AO_CC115L_SPI_CS_PIN));
ao_radio_configured = 0;
ao_spi_init_cs (AO_CC115L_SPI_CS_PORT, (1 << AO_CC115L_SPI_CS_PIN));
ao_adc_dump(void) __reentrant
{
struct ao_data packet;
ao_adc_dump(void) __reentrant
{
struct ao_data packet;
ao_data_get(&packet);
#ifdef AO_ADC_DUMP
ao_data_get(&packet);
#ifdef AO_ADC_DUMP
static struct lpc_ssp * const ao_lpc_ssp[LPC_NUM_SPI] = { &lpc_ssp0, &lpc_ssp1 };
static struct lpc_ssp * const ao_lpc_ssp[LPC_NUM_SPI] = { &lpc_ssp0, &lpc_ssp1 };
-static uint8_t spi_dev_null;
-
#define tx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_TNF))) != (1 << LPC_SSP_SR_TNF)
#define rx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_RNE))) != (1 << LPC_SSP_SR_RNE)
#define tx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_TNF))) != (1 << LPC_SSP_SR_TNF)
#define rx_busy(lpc_ssp) (lpc_ssp->sr & ((1 << LPC_SSP_SR_BSY) | (1 << LPC_SSP_SR_RNE))) != (1 << LPC_SSP_SR_RNE)
static uint8_t ao_usb_out_avail;
static uint8_t ao_usb_running;
static uint8_t ao_usb_configuration;
static uint8_t ao_usb_out_avail;
static uint8_t ao_usb_running;
static uint8_t ao_usb_configuration;
-static uint8_t ueienx_0;
#define AO_USB_EP0_GOT_RESET 1
#define AO_USB_EP0_GOT_SETUP 2
#define AO_USB_EP0_GOT_RESET 1
#define AO_USB_EP0_GOT_SETUP 2
return &lpc_usb_endpoint.epn[n-1].in[0];
}
return &lpc_usb_endpoint.epn[n-1].in[0];
}
static void
ao_usb_set_epn_in(uint8_t n, uint8_t *addr, uint16_t nbytes)
{
ao_usb_set_ep(ao_usb_epn_in(n), addr, nbytes);
}
static void
ao_usb_set_epn_in(uint8_t n, uint8_t *addr, uint16_t nbytes)
{
ao_usb_set_ep(ao_usb_epn_in(n), addr, nbytes);
}
static void
ao_usb_set_epn_out(uint8_t n, uint8_t *addr, uint16_t nbytes)
static void
ao_usb_set_epn_out(uint8_t n, uint8_t *addr, uint16_t nbytes)
-static uint16_t control_count;
static uint16_t int_count;
static uint16_t in_count;
static uint16_t out_count;
static uint16_t reset_count;
static uint16_t int_count;
static uint16_t in_count;
static uint16_t out_count;
static uint16_t reset_count;
void
lpc_usb_irq_isr(void)
void
lpc_usb_irq_isr(void)
/* Handle OUT packets */
if (intstat & (1 << LPC_USB_INT_EPOUT(AO_USB_OUT_EP))) {
/* Handle OUT packets */
if (intstat & (1 << LPC_USB_INT_EPOUT(AO_USB_OUT_EP))) {
_rx_dbg1("RX ISR", *ao_usb_epn_out(AO_USB_OUT_EP));
ao_usb_out_avail = 1;
_rx_dbg0("out avail set");
_rx_dbg1("RX ISR", *ao_usb_epn_out(AO_USB_OUT_EP));
ao_usb_out_avail = 1;
_rx_dbg0("out avail set");
/* Handle IN packets */
if (intstat & (1 << LPC_USB_INT_EPIN(AO_USB_IN_EP))) {
/* Handle IN packets */
if (intstat & (1 << LPC_USB_INT_EPIN(AO_USB_IN_EP))) {
_tx_dbg1("TX ISR", *ao_usb_epn_in(AO_USB_IN_EP));
ao_usb_in_pending = 0;
ao_wakeup(&ao_usb_in_pending);
_tx_dbg1("TX ISR", *ao_usb_epn_in(AO_USB_IN_EP));
ao_usb_in_pending = 0;
ao_wakeup(&ao_usb_in_pending);
void
ao_panic(uint8_t reason)
{
void
ao_panic(uint8_t reason)
{