altos: Clean up warnings for LPC products
authorKeith Packard <keithp@keithp.com>
Sat, 21 Dec 2013 06:58:10 +0000 (22:58 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 21 Dec 2013 06:59:35 +0000 (22:59 -0800)
Unused varibles, functions and parameters.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_log.c
src/core/ao_log_mini.c
src/core/ao_notask.c
src/core/ao_telemetry.c
src/drivers/ao_cc115l.c
src/lpc/ao_adc_lpc.c
src/lpc/ao_spi_lpc.c
src/lpc/ao_usb_lpc.c
src/product/ao_flash_task.c

index 701c81aba7444ba95c8a4ae7203c5fa7683c61dc..20febefe27f2df4693ad4cd02b6f31b96aaa20ea 100644 (file)
@@ -196,7 +196,9 @@ ao_log_full(void)
        return ao_log_current_pos == ao_log_end_pos;
 }
 
+#if HAS_ADC
 static __xdata struct ao_task ao_log_task;
+#endif
 
 void
 ao_log_list(void) __reentrant
index 99a85982042b676115b30dac7a5c1fbdd470fe95..29e3bd9f6d87fcc40dfc570c1a571765aea95552 100644 (file)
@@ -78,7 +78,7 @@ typedef uint8_t check_log_size[1-(256 % sizeof(struct ao_log_mini))] ;
 void
 ao_log(void)
 {
-       __pdata uint16_t        next_sensor, next_other;
+       __pdata uint16_t        next_sensor;
 
        ao_storage_setup();
 
@@ -99,7 +99,7 @@ ao_log(void)
         * 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 */
index a41712d2d3a248c07ff56c1c9cbe229cf3f6d7d9..6f967e6d2201db4d520f5410c33f7a038f00491d 100644 (file)
@@ -41,5 +41,6 @@ ao_sleep(__xdata void *wchan)
 void
 ao_wakeup(__xdata void *wchan)
 {
+       (void) wchan;
        ao_wchan = 0;
 }
index 861580637d7e9c1e074d3d93472393b4f65d134e..5a00d825671d7ae35ceee5f1f06ddce0b7f98081 100644 (file)
@@ -24,9 +24,9 @@
 #endif
 
 static __pdata uint16_t ao_telemetry_interval;
-static __pdata uint8_t ao_rdf = 0;
 
 #if HAS_RDF
+static __pdata uint8_t ao_rdf = 0;
 static __pdata uint16_t ao_rdf_time;
 #endif
 
index 0fa1e899044a23fae470cbaa7ac1b9a657b84014..5d4f3bd666892160699fdb7c7dc758b1e53465f8 100644 (file)
@@ -29,8 +29,6 @@ static uint8_t ao_radio_fifo;         /* fifo drained interrupt received */
 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
@@ -106,7 +104,6 @@ static uint8_t
 ao_radio_reg_read(uint8_t addr)
 {
        uint8_t data[1];
-       uint8_t d;
 
        data[0] = ((1 << CC115L_READ)  |
                   (0 << CC115L_BURST) |
@@ -123,7 +120,6 @@ static void
 ao_radio_reg_write(uint8_t addr, uint8_t value)
 {
        uint8_t data[2];
-       uint8_t d;
 
        trace_add(trace_write, addr, value, NULL);
        data[0] = ((0 << CC115L_READ)  |
@@ -135,11 +131,11 @@ ao_radio_reg_write(uint8_t addr, uint8_t value)
        ao_radio_deselect();
 }
 
+#if UNUSED
 static void
 ao_radio_burst_read_start (uint16_t addr)
 {
        uint8_t data[1];
-       uint8_t d;
 
        data[0] = ((1 << CC115L_READ)  |
                   (1 << CC115L_BURST) |
@@ -153,6 +149,7 @@ ao_radio_burst_read_stop (void)
 {
        ao_radio_deselect();
 }
+#endif
 
 
 static uint8_t
@@ -200,19 +197,23 @@ ao_radio_tx_fifo_space(void)
        return CC115L_FIFO_SIZE - (ao_radio_reg_read(CC115L_TXBYTES) & CC115L_TXBYTES_NUM_TX_BYTES_MASK);
 }
 
+#if UNUSED
 static uint8_t
 ao_radio_status(void)
 {
        return ao_radio_strobe (CC115L_SNOP);
 }
+#endif
 
 #define ao_radio_rdf_value 0x55
 
+#if UNUSED
 static uint8_t
 ao_radio_get_marcstate(void)
 {
        return ao_radio_reg_read(CC115L_MARCSTATE) & CC115L_MARCSTATE_MASK;
 }
+#endif
          
 static void
 ao_radio_done_isr(void)
@@ -232,11 +233,6 @@ ao_radio_fifo_isr(void)
        ao_wakeup(&ao_radio_wake);
 }
 
-static void
-ao_radio_start_tx(void)
-{
-}
-
 static void
 ao_radio_idle(void)
 {
@@ -401,7 +397,7 @@ static void
 ao_radio_set_mode(uint16_t new_mode)
 {
        uint16_t changes;
-       int i;
+       unsigned int i;
 
        if (new_mode == ao_radio_mode)
                return;
@@ -466,7 +462,7 @@ static uint8_t      ao_radio_configured = 0;
 static void
 ao_radio_setup(void)
 {
-       int     i;
+       unsigned int    i;
 
        ao_radio_strobe(CC115L_SRES);
        ao_delay(AO_MS_TO_TICKS(10));
@@ -730,8 +726,6 @@ ao_radio_send_fill(uint8_t *buf, int16_t len)
 void
 ao_radio_send(const void *d, uint8_t size)
 {
-       int i;
-
        ao_radio_get();
        ao_radio_send_len = ao_fec_encode(d, size, tx_data);
        ao_radio_send_buf = tx_data;
@@ -912,7 +906,6 @@ static void ao_radio_packet(void) {
        ao_radio_send(packet, sizeof (packet));
 }
 
-#endif /* CC115L_DEBUG */
 
 #if HAS_APRS
 #include <ao_aprs.h>
@@ -926,6 +919,7 @@ ao_radio_aprs()
        ao_aprs_send();
 }
 #endif
+#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" },
@@ -943,7 +937,9 @@ static const struct ao_cmds ao_radio_cmds[] = {
 void
 ao_radio_init(void)
 {
+#if 0
        int     i;
+#endif
 
        ao_radio_configured = 0;
        ao_spi_init_cs (AO_CC115L_SPI_CS_PORT, (1 << AO_CC115L_SPI_CS_PIN));
index 7005f86e62a9d4c51743316b666847e07ba75d19..e1aae0e484d5c726910185e5c15907c41a5932f6 100644 (file)
@@ -149,8 +149,10 @@ static void
 ao_adc_dump(void) __reentrant
 {
        struct ao_data  packet;
+#ifndef AO_ADC_DUMP
        int16_t *d;
        uint8_t i;
+#endif
 
        ao_data_get(&packet);
 #ifdef AO_ADC_DUMP
index a889137cbb7a4e1f84437f601d76e78f8cc22ce8..e72b8286634adfbb0fe3b8e3f97bcfbbf2c92d3e 100644 (file)
@@ -21,8 +21,6 @@ static uint8_t                ao_spi_mutex[LPC_NUM_SPI];
 
 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)
 
index 686dc3a4bd8019d6c2e44251c1bbb10a01f586be..d02ccdd6a5cbe06ab4ab74f951765b9e66dd0f73 100644 (file)
@@ -111,7 +111,6 @@ static uint8_t      ao_usb_in_pending;
 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
@@ -246,11 +245,13 @@ ao_usb_epn_in(uint8_t n)
        return &lpc_usb_endpoint.epn[n-1].in[0];
 }
 
+#if UNUSED
 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);
 }
+#endif
 
 static void
 ao_usb_set_epn_out(uint8_t n, uint8_t *addr, uint16_t nbytes)
@@ -633,11 +634,12 @@ ao_usb_ep0_handle(uint8_t receive)
        }
 }
 
-static uint16_t        control_count;
+#if USB_DEBUG
 static uint16_t int_count;
 static uint16_t        in_count;
 static uint16_t        out_count;
 static uint16_t        reset_count;
+#endif
 
 void
 lpc_usb_irq_isr(void)
@@ -665,7 +667,9 @@ lpc_usb_irq_isr(void)
 
        /* Handle OUT packets */
        if (intstat & (1 << LPC_USB_INT_EPOUT(AO_USB_OUT_EP))) {
+#if USB_DEBUG
                ++out_count;
+#endif
                _rx_dbg1("RX ISR", *ao_usb_epn_out(AO_USB_OUT_EP));
                ao_usb_out_avail = 1;
                _rx_dbg0("out avail set");
@@ -675,7 +679,9 @@ lpc_usb_irq_isr(void)
 
        /* Handle IN packets */
        if (intstat & (1 << LPC_USB_INT_EPIN(AO_USB_IN_EP))) {
+#if USB_DEBUG
                ++in_count;
+#endif
                _tx_dbg1("TX ISR", *ao_usb_epn_in(AO_USB_IN_EP));
                ao_usb_in_pending = 0;
                ao_wakeup(&ao_usb_in_pending);
index 4cfbf75fde3d15c38b7b8ab0809bb9a85abfc3d8..6cb308e1fa5ee580656af86757ddbcf9c4bcd97f 100644 (file)
@@ -24,6 +24,7 @@
 void
 ao_panic(uint8_t reason)
 {
+       (void) reason;
 }
 
 void