diff --git a/fw_dc22_stm32l100/include/pirate.h b/fw_dc22_stm32l100/include/pirate.h index 135f551..27f5da0 100644 --- a/fw_dc22_stm32l100/include/pirate.h +++ b/fw_dc22_stm32l100/include/pirate.h @@ -1,11 +1,6 @@ /** * pirate.h: half-assed piracy-enabling features for drunken, brazen pirates * 2014 by true - * - * ---- - * - * $Id: pirate.h 505 2021-09-05 19:07:51Z true $ - * **/ #ifndef __PIRATE_PIRATE_H @@ -81,18 +76,19 @@ extern uint32_t pirate_prng_val; /* pirate functions */ -void pirate_shutdown(uint16_t type); +void pirate_shutdown(uint16_t type); -uint8_t pirate_prng(); -void pirate_delay(uint16_t ms); -int16_t pirate_scale(int16_t value, int16_t src_min, int16_t src_max, int16_t dest_min, int16_t dest_max); -char * pirate_itoa(uint32_t val, uint8_t base, uint8_t leftpad); -char * pirate_sitoa(int32_t val, uint8_t base, uint8_t leftpad); +uint8_t pirate_prng(); +void pirate_delay(uint16_t ms); +int16_t pirate_scale(int16_t value, int16_t src_min, int16_t src_max, int16_t dest_min, int16_t dest_max); +char * pirate_itoa(uint32_t val, uint8_t base, uint8_t leftpad); +char * pirate_sitoa(int32_t val, uint8_t base, uint8_t leftpad); uint16_t pirate_batt_voltage(); -void pirate_batt_log(uint16_t rawvalue); +void pirate_batt_log(uint16_t rawvalue); uint16_t pirate_thermometer(uint8_t deg_f); -void pirate_thermometer_log(uint8_t temp); +void pirate_thermometer_log(uint8_t temp); -#endif + +#endif /* __PIRATE_PIRATE_H */ \ No newline at end of file diff --git a/fw_dc22_stm32l100/src/device/attiny.c b/fw_dc22_stm32l100/src/device/attiny.c index 27d5adf..328833a 100644 --- a/fw_dc22_stm32l100/src/device/attiny.c +++ b/fw_dc22_stm32l100/src/device/attiny.c @@ -4,12 +4,7 @@ * * ---- * - * $Id: attiny.c 375 2015-07-06 02:52:40Z true $ - * - * ---- - * * attiny88's I2C address is 0x73 - see led_eyes.h for define - * **/ #include // for settings diff --git a/fw_dc22_stm32l100/src/device/attiny.h b/fw_dc22_stm32l100/src/device/attiny.h index afd250e..a18f359 100644 --- a/fw_dc22_stm32l100/src/device/attiny.h +++ b/fw_dc22_stm32l100/src/device/attiny.h @@ -1,15 +1,10 @@ /** * attiny.h: interface to attiny88's RGBLED eyes prototypes * 2014 true - * - * ---- - * - * $Id: attiny.h 375 2015-07-06 02:52:40Z true $ - * **/ -#ifndef __PIRATE_DEV_ATTINY_H -#define __PIRATE_DEV_ATTINY_H +#ifndef __DEVICE_ATTINY_H +#define __DEVICE_ATTINY_H @@ -17,26 +12,26 @@ #define ATTINY_I2C_DEV I2C1 #define ATTINY_I2C_ADDR 0x73 - // write register commands, last 4 bits = data, >1 packet +// write register commands, last 4 bits = data, >1 packet #define ATTINY_CMD_EXT_CMD 0x10 // pkt = ext command (bit[7:4] must NOT == 0) #define ATTINY_CMD_LED_LEVEL 0x20 // cmd[3:0] = led, pkt = level (0-250) #define ATTINY_CMD_TEMP_CAL 0x30 // pkt = current temperature -#define ATTINY_CMD_EEPROM_READ 0x40 // pkt = address, read 1 byte after this command +#define ATTINY_CMD_EEPROM_READ 0x40 // pkt = address, read 1 byte after this command #define ATTINY_CMD_EEPROM_WRITE 0x50 // pkt[0] = address, pkt[1] = data - // write register commands, last 4 bits = data, immediate processing 1 packet + +// write register commands, last 4 bits = data, immediate processing 1 packet #define ATTINY_CMD_READ_TEMP 0x80 // read 1 byte after this command #define ATTINY_CMD_READ_LIGHT 0x90 // cmd[3:0] = led (from 0-3), read 1 byte after this command #define ATTINY_CMD_SLEEP 0xF0 // no data - // write register commands, extended + +// write register commands, extended #define ATTINY_CMD_LIGHTSENSOR_SENS 0x1019 // 2 bytes data - led, new sensitivity value - -/* leds */ +// leds #define LED_EYES_LEFT 0 #define LED_EYES_RIGHT 1 - -/* programs */ +// programs #define LED_EYES_MODE_OFF 0 #define LED_EYES_MODE_PROGRAM 2 @@ -62,4 +57,4 @@ void attiny_sleep(); -#endif +#endif /* __DEVICE_ATTINY_H */ diff --git a/fw_dc22_stm32l100/src/device/beep.c b/fw_dc22_stm32l100/src/device/beep.c index 2508084..674804b 100644 --- a/fw_dc22_stm32l100/src/device/beep.c +++ b/fw_dc22_stm32l100/src/device/beep.c @@ -4,10 +4,6 @@ * * ---- * - * $Id: beep.c 327 2015-02-18 04:43:42Z true $ - * - * ---- - * * TODO: remove freq lookup table, replace with freq defines by note (A4 = 440 for example) * TODO: let you know that the device we chose cannot play music; it is a buzzer. * TODO: do what you want 'cause a pirate is free diff --git a/fw_dc22_stm32l100/src/device/beep.h b/fw_dc22_stm32l100/src/device/beep.h index 7841334..ae38306 100644 --- a/fw_dc22_stm32l100/src/device/beep.h +++ b/fw_dc22_stm32l100/src/device/beep.h @@ -3,16 +3,14 @@ * 2014 by true * * ---- - * - * $Id: beep.h 327 2015-02-18 04:43:42Z true $ - * + * * do what you want 'cause a pirate is free * you are a pirate * **/ -#ifndef __PIRATE_DEV_BEEP_H -#define __PIRATE_DEV_BEEP_H +#ifndef __DEVICE_BEEP_H +#define __DEVICE_BEEP_H @@ -29,4 +27,4 @@ uint16_t beep(uint16_t tone_id, uint16_t duration); -#endif +#endif /* __DEVICE_BEEP_H */ diff --git a/fw_dc22_stm32l100/src/device/beep_song.h b/fw_dc22_stm32l100/src/device/beep_song.h index 794ed57..2e8819c 100644 --- a/fw_dc22_stm32l100/src/device/beep_song.h +++ b/fw_dc22_stm32l100/src/device/beep_song.h @@ -1,11 +1,6 @@ /** * beep_music.h: musical scores for pirates * 2014 by true - * - * ---- - * - * $Id: beep_song.h 327 2015-02-18 04:43:42Z true $ - * **/ static MusicSong you_are_a_pirate[] = { diff --git a/fw_dc22_stm32l100/src/device/lcd.c b/fw_dc22_stm32l100/src/device/lcd.c index bfa0d54..c0cbb9d 100644 --- a/fw_dc22_stm32l100/src/device/lcd.c +++ b/fw_dc22_stm32l100/src/device/lcd.c @@ -1,11 +1,6 @@ /** * lcd.c: lcd menuing and support functions * 2014 by true - * - * ---- - * - * $Id: lcd.c 327 2015-02-18 04:43:42Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/device/lcd.h b/fw_dc22_stm32l100/src/device/lcd.h index 929e4e7..a901969 100644 --- a/fw_dc22_stm32l100/src/device/lcd.h +++ b/fw_dc22_stm32l100/src/device/lcd.h @@ -1,15 +1,10 @@ /** * lcd.c: lcd menuing and support function prototypes * 2014 by true - * - * ---- - * - * $Id: lcd.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_DEV_LCD_H -#define __PIRATE_DEV_LCD_H +#ifndef __DEVICE_LCD_H +#define __DEVICE_LCD_H @@ -69,4 +64,4 @@ void lcd_led_update(); -#endif +#endif /* __DEVICE_LCD_H */ diff --git a/fw_dc22_stm32l100/src/device/lightsensor.c b/fw_dc22_stm32l100/src/device/lightsensor.c index 55cf19e..560929e 100644 --- a/fw_dc22_stm32l100/src/device/lightsensor.c +++ b/fw_dc22_stm32l100/src/device/lightsensor.c @@ -1,11 +1,6 @@ /** * lightsensor.c: control of the attiny's light sensor output plus helper functions * 2014 true - * - * ---- - * - * $Id: lightsensor.c 327 2015-02-18 04:43:42Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/device/lightsensor.h b/fw_dc22_stm32l100/src/device/lightsensor.h index 5f7f13c..ca0d552 100644 --- a/fw_dc22_stm32l100/src/device/lightsensor.h +++ b/fw_dc22_stm32l100/src/device/lightsensor.h @@ -1,16 +1,10 @@ /** * lightsensor.h: control of the attiny's light sensor output plus helper functions * 2014 true - * - * ---- - * - * $Id: lightsensor.h 327 2015-02-18 04:43:42Z true $ - * **/ - -#ifndef __PIRATE_DEV_LIGHTSENSOR_H -#define __PIRATE_DEV_LIGHTSENSOR_H +#ifndef __DEVICE_LIGHTSENSOR_H +#define __DEVICE_LIGHTSENSOR_H @@ -45,4 +39,4 @@ uint8_t lightsensor_get_scalerval(uint8_t which); -#endif +#endif /* __DEVICE_LIGHTSENSOR_H */ diff --git a/fw_dc22_stm32l100/src/device/radio/address.c b/fw_dc22_stm32l100/src/device/radio/address.c index 71874da..4e2c243 100644 --- a/fw_dc22_stm32l100/src/device/radio/address.c +++ b/fw_dc22_stm32l100/src/device/radio/address.c @@ -1,10 +1,10 @@ /** - * radio/address.c: address buffers and lookups + * address.c: address buffers and lookups * 2015 by true * - * $Id$ - * **/ +/* static char dc22_name[32][8]; static char dc23_name[300][3]; +*/ \ No newline at end of file diff --git a/fw_dc22_stm32l100/src/device/radio/address.h b/fw_dc22_stm32l100/src/device/radio/address.h index 6296548..fbd8247 100644 --- a/fw_dc22_stm32l100/src/device/radio/address.h +++ b/fw_dc22_stm32l100/src/device/radio/address.h @@ -1,7 +1,4 @@ /** - * radio/address.h: address buffers and lookups + * address.h: address buffers and lookups * 2015 by true - * - * $Id$ - * **/ diff --git a/fw_dc22_stm32l100/src/device/radio/irq.c b/fw_dc22_stm32l100/src/device/radio/irq.c index 3608976..83363f4 100644 --- a/fw_dc22_stm32l100/src/device/radio/irq.c +++ b/fw_dc22_stm32l100/src/device/radio/irq.c @@ -1,11 +1,6 @@ /** - * radio/irq.c: nrf irq handler + * irq.c: nrf irq handler * 2015 by true - - * ---- - * - * $Id$ - * **/ #include diff --git a/fw_dc22_stm32l100/src/device/radio/nrf.c b/fw_dc22_stm32l100/src/device/radio/nrf.c index 23fcdda..ff1ea0b 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf.c +++ b/fw_dc22_stm32l100/src/device/radio/nrf.c @@ -7,11 +7,6 @@ * This is a nasty hack implementation of the NRF24L01+. * Modify as necessary if using on another STM32; see nrf.h * and the NRF24L01 library. - * - * ---- - * - * $Id: nrf.c 375 2015-07-06 02:52:40Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/device/radio/nrf.h b/fw_dc22_stm32l100/src/device/radio/nrf.h index 34c15c4..98803c4 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf.h +++ b/fw_dc22_stm32l100/src/device/radio/nrf.h @@ -8,8 +8,8 @@ * **/ -#ifndef __PIRATE_DEV_NRF24L01_H -#define __PIRATE_DEV_NRF24L01_H +#ifndef __DEVICE_NRF_H +#define __DEVICE_NRF_H /* libraries */ @@ -51,4 +51,5 @@ void nrf_init(); uint8_t nrf_checksum(uint8_t *data, uint8_t len, int32_t offset); -#endif + +#endif /* __DEVICE_NRF_H */ diff --git a/fw_dc22_stm32l100/src/device/radio/nrf24l01/nRF24L01.h b/fw_dc22_stm32l100/src/device/radio/nrf24l01/nRF24L01.h index eb18c0d..a26acf4 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf24l01/nRF24L01.h +++ b/fw_dc22_stm32l100/src/device/radio/nrf24l01/nRF24L01.h @@ -26,8 +26,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef _NRF24L01_H -#define _NRF24L01_H +#ifndef __NRF24L01_H +#define __NRF24L01_H #define NRF_BIT0 1 << 0 @@ -183,4 +183,4 @@ -#endif +#endif /* __NRF24L01_H */ diff --git a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.c b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.c index 2f53e36..828bb7b 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.c +++ b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.c @@ -2,8 +2,7 @@ * true's NRF24L01+ C library * shamelessly stolen and modified heavily from some other shit * basically: it's better than nothing - * - * $Id: true_nRF24L01.c 505 2021-09-05 19:07:51Z true $ + * * ==== * * general instructions to set up: diff --git a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.h b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.h index 73e1768..81deba0 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.h +++ b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01.h @@ -2,8 +2,6 @@ * true's NRF24L01+ C library * shamelessly stolen and modified heavily from some other shit * basically: it's better than nothing - * - * $Id: true_nRF24L01.h 505 2021-09-05 19:07:51Z true $ */ @@ -75,6 +73,7 @@ typedef struct nrfConfig { } nrfConfig; + /* data handling */ void (*nRF24_rx_cb)(uint8_t pipe, uint8_t *pBuf, uint8_t len); void (*nRF24_tx_done_cb)(); @@ -82,7 +81,7 @@ void (*nRF24_tx_max_rt_cb)(); /* function prototypes */ -void nRF24_init(uint32_t cpu_freq); +void nRF24_init(uint32_t cpu_freq); uint8_t nRF24_interrupt(); uint8_t nRF24_reg_rw(uint8_t reg, uint8_t value); @@ -93,36 +92,37 @@ uint8_t nRF24_buf_read(uint8_t reg, void *pBuf, uint8_t bytes); uint8_t nRF24_is_present(void); -void nRF24_set_txaddr(const uint8_t *addr); -void nRF24_set_rxaddr(uint8_t pipe, const uint8_t *addr); +void nRF24_set_txaddr(const uint8_t *addr); +void nRF24_set_rxaddr(uint8_t pipe, const uint8_t *addr); -void nRF24_set_channel(uint8_t chan); -void nRF24_set_rate(uint8_t rate); -void nRF24_set_power(uint8_t power); -void nRF24_set_addr_width(uint8_t width); -void nRF24_set_payload_size(uint8_t pipe, uint8_t size); -void nRF24_set_crc(uint8_t crc); -void nRF24_set_pipe(uint8_t pipe, uint8_t onoff); -void nRF24_set_autoack(uint8_t pipe, uint8_t onoff); -void nRF24_set_dynack(uint8_t onoff); +void nRF24_set_channel(uint8_t chan); +void nRF24_set_rate(uint8_t rate); +void nRF24_set_power(uint8_t power); +void nRF24_set_addr_width(uint8_t width); +void nRF24_set_payload_size(uint8_t pipe, uint8_t size); +void nRF24_set_crc(uint8_t crc); +void nRF24_set_pipe(uint8_t pipe, uint8_t onoff); +void nRF24_set_autoack(uint8_t pipe, uint8_t onoff); +void nRF24_set_dynack(uint8_t onoff); -void nRF24_update_config(uint8_t mask); +void nRF24_update_config(uint8_t mask); -void nRF24_set_tx_config(uint8_t max_rt_flush, uint8_t new_done_state); +void nRF24_set_tx_config(uint8_t max_rt_flush, uint8_t new_done_state); -void nRF24_mode_rx(); -void nRF24_mode_tx(); -void nRF24_mode_standby(); -void nRF24_mode_off(); +void nRF24_mode_rx(); +void nRF24_mode_tx(); +void nRF24_mode_standby(); +void nRF24_mode_off(); uint8_t nRF24_mode_get(); uint8_t nRF24_data_is_ready(void); -int8_t nRF24_packet_rx(uint8_t status, void *pBuf); -void nRF24_packet_tx(void *pBuf, uint8_t bytes, uint8_t noack); +int8_t nRF24_packet_rx(uint8_t status, void *pBuf); +void nRF24_packet_tx(void *pBuf, uint8_t bytes, uint8_t noack); uint8_t nRF24_rx_received_pipe(); -void nRF24_clear_irq_flags(void); +void nRF24_clear_irq_flags(void); -#endif + +#endif /* __TRUE_NRF24L01_LIB_H */ diff --git a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.c b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.c index dc31853..2510a07 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.c +++ b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.c @@ -2,8 +2,6 @@ * true's NRF24L01 C library * STM32L1xx interface driver * basically: it's better than nothing - * - * $Id: true_nRF24L01_stm32l1xx.c 375 2015-07-06 02:52:40Z true $ */ diff --git a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.h b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.h index 3b9d623..1d73586 100644 --- a/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.h +++ b/fw_dc22_stm32l100/src/device/radio/nrf24l01/true_nRF24L01_stm32l1xx.h @@ -2,8 +2,6 @@ * true's NRF24L01 C library * STM32L1xx interface driver header * basically: it's better than nothing - * - * $Id: true_nRF24L01_stm32l1xx.h 375 2015-07-06 02:52:40Z true $ */ @@ -88,4 +86,4 @@ uint8_t nRF24_spi_rw(uint8_t data); -#endif +#endif /* __TRUE_NRF24L01_STM32L1XX_H */ diff --git a/fw_dc22_stm32l100/src/display/cgram/cgram.c b/fw_dc22_stm32l100/src/display/cgram/icons.c similarity index 75% rename from fw_dc22_stm32l100/src/display/cgram/cgram.c rename to fw_dc22_stm32l100/src/display/cgram/icons.c index b1ba2a5..2e917fa 100644 --- a/fw_dc22_stm32l100/src/display/cgram/cgram.c +++ b/fw_dc22_stm32l100/src/display/cgram/icons.c @@ -1,15 +1,15 @@ /** - * cgram.c: lcd cgram graphics constants - * 2014 by true - * + * icons.c: lcd cgram graphics constants + * 2023 by true + * * ---- * - * $Id: cgram.c 327 2015-02-18 04:43:42Z true $ - * + * TODO: add resources for how to generate new icons and graphics **/ #include + const uint8_t cgram_crown[6][8] = { {0x00, 0x00, 0x1C, 0x14, 0x1C, 0x0C, 0x0A, 0x09}, {0x0E, 0x0A, 0x0E, 0x04, 0x04, 0x0A, 0x11, 0x00}, diff --git a/fw_dc22_stm32l100/src/display/cgram/cgram.h b/fw_dc22_stm32l100/src/display/cgram/icons.h similarity index 57% rename from fw_dc22_stm32l100/src/display/cgram/cgram.h rename to fw_dc22_stm32l100/src/display/cgram/icons.h index dca3bdd..b3872ea 100644 --- a/fw_dc22_stm32l100/src/display/cgram/cgram.h +++ b/fw_dc22_stm32l100/src/display/cgram/icons.h @@ -1,20 +1,16 @@ /** - * cgram.h: lcd cgram graphics constants + * icons.h: lcd cgram graphics constants * 2014 by true - * - * ---- - * - * $Id: cgram.h 327 2015-02-18 04:43:42Z true $ - * **/ #ifndef __PIRATE_DISPLAY_CGRAM_H #define __PIRATE_DISPLAY_CGRAM_H +#include + extern const uint8_t cgram_crown[6][8]; - #endif diff --git a/fw_dc22_stm32l100/src/display/infopirate.c b/fw_dc22_stm32l100/src/display/infopirate.c index 3f46130..37c46b8 100644 --- a/fw_dc22_stm32l100/src/display/infopirate.c +++ b/fw_dc22_stm32l100/src/display/infopirate.c @@ -1,11 +1,6 @@ /** * infopirate.c: namebadge and other information animated 8x2 display * 2014 by true - * - * ---- - * - * $Id: infopirate.c 327 2015-02-18 04:43:42Z true $ - * **/ #include @@ -17,8 +12,6 @@ #include "infopirate.h" #include "infopirate_prog.h" -#include "cgram/cgram.h" - uint8_t prog_idx; // currently selected program uint8_t prog_loop; // current loop thru program diff --git a/fw_dc22_stm32l100/src/display/infopirate.h b/fw_dc22_stm32l100/src/display/infopirate.h index 431413d..7372a47 100644 --- a/fw_dc22_stm32l100/src/display/infopirate.h +++ b/fw_dc22_stm32l100/src/display/infopirate.h @@ -1,15 +1,10 @@ /** * infopirate.h: namebadge and other information animated 8x2 display * 2014 by true - * - * ---- - * - * $Id: infopirate.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_DISPLAY_INFOPIRATE_H -#define __PIRATE_DISPLAY_INFOPIRATE_H +#ifndef __DISPLAY_INFOPIRATE_H +#define __DISPLAY_INFOPIRATE_H @@ -30,4 +25,4 @@ void menu_infopirate_btn_ok(); -#endif +#endif /* __DISPLAY_INFOPIRATE_H */ diff --git a/fw_dc22_stm32l100/src/display/infopirate_prog.h b/fw_dc22_stm32l100/src/display/infopirate_prog.h index 72db3a2..dd1a948 100644 --- a/fw_dc22_stm32l100/src/display/infopirate_prog.h +++ b/fw_dc22_stm32l100/src/display/infopirate_prog.h @@ -1,20 +1,15 @@ /** * infopirate_prog.h: program functions for badge related bullshit * 2014 by true - * - * ---- - * - * $Id: infopirate_prog.h 327 2015-02-18 04:43:42Z true $ - * **/ #include "../menu/lcd_menu.h" -#include "cgram/cgram.h" // for CGRAM graphics tables +#include "cgram/icons.h" // for CGRAM graphics tables -uint16_t prog_wait; // used by function to keep track of iteration time -uint32_t prog_state[4]; // used by the function to keep track of state -uint32_t prog_work[2]; // used for misc shit +uint16_t prog_wait; // used by function to keep track of iteration time +uint32_t prog_state[4]; // used by the function to keep track of state +uint32_t prog_work[2]; // used for misc shit /* functions */ diff --git a/fw_dc22_stm32l100/src/interface/adc.c b/fw_dc22_stm32l100/src/interface/adc.c index be9f662..0e6c5c1 100644 --- a/fw_dc22_stm32l100/src/interface/adc.c +++ b/fw_dc22_stm32l100/src/interface/adc.c @@ -1,11 +1,6 @@ /** * adc.h: manager for anything adc-related * 2014 by true - * - * ---- - * - * $Id: adc.c 327 2015-02-18 04:43:42Z true $ - * **/ diff --git a/fw_dc22_stm32l100/src/interface/adc.h b/fw_dc22_stm32l100/src/interface/adc.h index 0845599..156fcde 100644 --- a/fw_dc22_stm32l100/src/interface/adc.h +++ b/fw_dc22_stm32l100/src/interface/adc.h @@ -1,15 +1,10 @@ /** * adc.h: prototypes for adc functions * 2014 by true - * - * ---- - * - * $Id: adc.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_IF_ADC_H -#define __PIRATE_IF_ADC_H +#ifndef __INTERFACE_ADC_H +#define __INTERFACE_ADC_H @@ -35,4 +30,4 @@ void adc_start(); -#endif +#endif /* __INTERFACE_ADC_H */ diff --git a/fw_dc22_stm32l100/src/interface/gpio.c b/fw_dc22_stm32l100/src/interface/gpio.c deleted file mode 100644 index 9044af7..0000000 --- a/fw_dc22_stm32l100/src/interface/gpio.c +++ /dev/null @@ -1,8 +0,0 @@ -/** - * pirate gpio interface - * 2014 true - * - * ---- - * - * $Id: gpio.c 327 2015-02-18 04:43:42Z true $ -**/ diff --git a/fw_dc22_stm32l100/src/interface/gpio.h b/fw_dc22_stm32l100/src/interface/gpio.h index 31a95ec..812a15b 100644 --- a/fw_dc22_stm32l100/src/interface/gpio.h +++ b/fw_dc22_stm32l100/src/interface/gpio.h @@ -1,19 +1,14 @@ /** * gpio.h: pirate gpio interface * 2014 true - * - * ---- - * - * $Id: gpio.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_IF_GPIO_H -#define __PIRATE_IF_GPIO_H +#ifndef __INTERFACE_GPIO_H +#define __INTERFACE_GPIO_H -#define BIT_0 1 +#define BIT_0 (1 << 0) #define BIT_1 (1 << 1) #define BIT_2 (1 << 2) #define BIT_3 (1 << 3) @@ -24,6 +19,8 @@ #define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0])) + + typedef struct tGPIO { GPIO_TypeDef *port; uint16_t pin; @@ -32,4 +29,4 @@ typedef struct tGPIO { -#endif +#endif /* __INTERFACE_GPIO_H */ diff --git a/fw_dc22_stm32l100/src/interface/i2c.c b/fw_dc22_stm32l100/src/interface/i2c.c index da07660..f2893ea 100644 --- a/fw_dc22_stm32l100/src/interface/i2c.c +++ b/fw_dc22_stm32l100/src/interface/i2c.c @@ -1,11 +1,6 @@ /** * i2c.h: pirate i2c interface, command and data buffering, and data receive callbacks * 2014 true - * - * ---- - * - * $Id: i2c.c 368 2015-06-16 06:49:48Z true $ - * **/ diff --git a/fw_dc22_stm32l100/src/interface/i2c.h b/fw_dc22_stm32l100/src/interface/i2c.h index 0da38ba..1ea4725 100644 --- a/fw_dc22_stm32l100/src/interface/i2c.h +++ b/fw_dc22_stm32l100/src/interface/i2c.h @@ -1,15 +1,10 @@ /** * i2c.h: pirate i2c interface, command and data buffering, and data receive callbacks * 2014 true - * - * ---- - * - * $Id: i2c.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_I2C_H -#define __PIRATE_I2C_H +#ifndef __INTERFACE_I2C_H +#define __INTERFACE_I2C_H @@ -28,4 +23,4 @@ void i2c_init(I2C_TypeDef *i2c, uint32_t speed); -#endif +#endif /* __INTERFACE_I2C_H */ diff --git a/fw_dc22_stm32l100/src/interface/led_pwm.c b/fw_dc22_stm32l100/src/interface/led_pwm.c index 11850b8..60fc0d4 100644 --- a/fw_dc22_stm32l100/src/interface/led_pwm.c +++ b/fw_dc22_stm32l100/src/interface/led_pwm.c @@ -1,11 +1,6 @@ /** * led_pwm.c: led pwm configuration functions * 2014 true - * - * ---- - * - * $Id: led_pwm.c 327 2015-02-18 04:43:42Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/interface/led_pwm.h b/fw_dc22_stm32l100/src/interface/led_pwm.h index f9f8968..88efbb0 100644 --- a/fw_dc22_stm32l100/src/interface/led_pwm.h +++ b/fw_dc22_stm32l100/src/interface/led_pwm.h @@ -1,15 +1,15 @@ /** * led_pwm.h: led pwm configuration prototypes * 2014 true - * - * ---- - * - * $Id: led_pwm.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_LED_PWM_H -#define __PIRATE_LED_PWM_H +#ifndef __INTERFACE_LED_PWM_H +#define __INTERFACE_LED_PWM_H + + + +#include +#include "stm32l1xx_tim.h" // for TIM_TypeDef @@ -19,10 +19,11 @@ #define LED_PWM_CH4 0x08 + /* prototypes */ void led_pwm_init_all(); void led_pwm_set_oc(TIM_TypeDef *timer, uint32_t *oc); -#endif +#endif /* __INTERFACE_LED_PWM_H */ diff --git a/fw_dc22_stm32l100/src/led/led_bone.c b/fw_dc22_stm32l100/src/led/led_bone.c index 236133d..adf3354 100644 --- a/fw_dc22_stm32l100/src/led/led_bone.c +++ b/fw_dc22_stm32l100/src/led/led_bone.c @@ -4,10 +4,6 @@ * * ---- * - * $Id: led_bone.c 373 2015-06-25 06:21:27Z true $ - * - * ---- - * * Resources: * - Uses TIM11 OC1 and TIM9 OC1 and OC2 for PWM output; for frequency, see led_pwm.c * diff --git a/fw_dc22_stm32l100/src/led/led_bone.h b/fw_dc22_stm32l100/src/led/led_bone.h index 9435c8b..61622fa 100644 --- a/fw_dc22_stm32l100/src/led/led_bone.h +++ b/fw_dc22_stm32l100/src/led/led_bone.h @@ -1,15 +1,10 @@ /** * led_bone.h: skull crossbones led matrix handling prototypes * 2014 true - * - * ---- - * - * $Id: led_bone.h 364 2015-06-12 04:44:55Z true $ - * **/ -#ifndef __PIRATE_LED_BONE_H -#define __PIRATE_LED_BONE_H +#ifndef __LED_LED_BONE_H +#define __LED_LED_BONE_H @@ -51,4 +46,4 @@ void led_bone_set_program(uint8_t program_idx, uint8_t init, -#endif +#endif /* __LED_LED_BONE_H */ diff --git a/fw_dc22_stm32l100/src/led/led_bone_pattern.h b/fw_dc22_stm32l100/src/led/led_bone_pattern.h index 6d15b53..4cff14c 100644 --- a/fw_dc22_stm32l100/src/led/led_bone_pattern.h +++ b/fw_dc22_stm32l100/src/led/led_bone_pattern.h @@ -1,11 +1,6 @@ /** * led_bone.c: skull crossbones led matrix fixed patterns * 2014 true - * - * ---- - * - * $Id: led_bone_pattern.h 327 2015-02-18 04:43:42Z true $ - * **/ // LEDs are in this arrangement: diff --git a/fw_dc22_stm32l100/src/led/led_bone_prog.h b/fw_dc22_stm32l100/src/led/led_bone_prog.h index 4f039a9..4e21510 100644 --- a/fw_dc22_stm32l100/src/led/led_bone_prog.h +++ b/fw_dc22_stm32l100/src/led/led_bone_prog.h @@ -1,11 +1,6 @@ /** * led_bone.c: skull crossbones led matrix fixed patterns * 2014 true - * - * ---- - * - * $Id: led_bone_prog.h 364 2015-06-12 04:44:55Z true $ - * **/ static uint16_t led_prog_wait; // used by function to keep track of iteration time diff --git a/fw_dc22_stm32l100/src/led/led_eyes_prog.h b/fw_dc22_stm32l100/src/led/led_eyes_prog.h index aec19c9..3acec2c 100644 --- a/fw_dc22_stm32l100/src/led/led_eyes_prog.h +++ b/fw_dc22_stm32l100/src/led/led_eyes_prog.h @@ -1,11 +1,6 @@ /* * led_eyes_prog.h: programs for the RGBLED eyes * 2014 by true - * - * ---- - * - * $Id: led_eyes_prog.h 375 2015-07-06 02:52:40Z true $ - * **/ uint16_t led_prog_wait; // used by function to keep track of iteration time diff --git a/fw_dc22_stm32l100/src/led/led_matrix.c b/fw_dc22_stm32l100/src/led/led_matrix.c index c6b1ec9..5f472ca 100644 --- a/fw_dc22_stm32l100/src/led/led_matrix.c +++ b/fw_dc22_stm32l100/src/led/led_matrix.c @@ -4,10 +4,6 @@ * * ---- * - * $Id: led_matrix.c 373 2015-06-25 06:21:27Z true $ - * - * ---- - * * Resources: * - Uses TIM2 and TIM3 as PWM output; for frequency, see led_pwm.c **/ diff --git a/fw_dc22_stm32l100/src/led/led_matrix.h b/fw_dc22_stm32l100/src/led/led_matrix.h index 5cea323..9c25634 100644 --- a/fw_dc22_stm32l100/src/led/led_matrix.h +++ b/fw_dc22_stm32l100/src/led/led_matrix.h @@ -1,15 +1,10 @@ /* * led_matrix.h: main skull led matrix handling prototypes * 2014 true - * - * ---- - * - * $Id: led_matrix.h 364 2015-06-12 04:44:55Z true $ - * **/ -#ifndef __PIRATE_LED_MATRIX_H -#define __PIRATE_LED_MATRIX_H +#ifndef __LED_LED_MATRIX_H +#define __LED_LED_MATRIX_H @@ -49,4 +44,4 @@ void led_matrix_set_program(uint8_t program_idx, uint8_t init, -#endif +#endif /* __LED_LED_MATRIX_H */ diff --git a/fw_dc22_stm32l100/src/led/led_matrix_pattern.h b/fw_dc22_stm32l100/src/led/led_matrix_pattern.h index 2ec4455..620b978 100644 --- a/fw_dc22_stm32l100/src/led/led_matrix_pattern.h +++ b/fw_dc22_stm32l100/src/led/led_matrix_pattern.h @@ -1,11 +1,6 @@ /** * led_matrix_pattern.h: fixed patterns for the RGBLED eyes * 2014 by true - * - * ---- - * - * $Id: led_matrix_pattern.h 327 2015-02-18 04:43:42Z true $ - * **/ // all LEDs on 100% diff --git a/fw_dc22_stm32l100/src/led/led_matrix_prog.h b/fw_dc22_stm32l100/src/led/led_matrix_prog.h index 0580ace..a677a83 100644 --- a/fw_dc22_stm32l100/src/led/led_matrix_prog.h +++ b/fw_dc22_stm32l100/src/led/led_matrix_prog.h @@ -1,11 +1,6 @@ /** * led_matrix_prog.h: programs for the main LED matrix * 2014 by true - * - * ---- - * - * $Id: led_matrix_prog.h 364 2015-06-12 04:44:55Z true $ - * **/ // program variables diff --git a/fw_dc22_stm32l100/src/menu/lcd_menu.c b/fw_dc22_stm32l100/src/menu/lcd_menu.c index 2c04fd4..89cc8a3 100644 --- a/fw_dc22_stm32l100/src/menu/lcd_menu.c +++ b/fw_dc22_stm32l100/src/menu/lcd_menu.c @@ -1,11 +1,6 @@ /** * lcd_menu.c: lcd menuing functions, in particular editing functions * 2014 by true - * - * ---- - * - * $Id: lcd_menu.c 368 2015-06-16 06:49:48Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/lcd_menu.h b/fw_dc22_stm32l100/src/menu/lcd_menu.h index 6772e07..35bede8 100644 --- a/fw_dc22_stm32l100/src/menu/lcd_menu.h +++ b/fw_dc22_stm32l100/src/menu/lcd_menu.h @@ -1,15 +1,10 @@ /** * lcd_menu.c: lcd menuing prototypes * 2014 by true - * - * ---- - * - * $Id: lcd_menu.h 374 2015-06-29 02:06:22Z true $ - * **/ -#ifndef __PIRATE_LCD_MENU_H -#define __PIRATE_LCD_MENU_H +#ifndef __MENU_LCD_MENU_H +#define __MENU_LCD_MENU_H @@ -103,4 +98,4 @@ void menu_btntype_editing(); -#endif +#endif /* __MENU_LCD_MENU_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_credits.c b/fw_dc22_stm32l100/src/menu/menu_credits.c index a8f8ad1..b4ee427 100644 --- a/fw_dc22_stm32l100/src/menu/menu_credits.c +++ b/fw_dc22_stm32l100/src/menu/menu_credits.c @@ -1,11 +1,6 @@ /** * menu_credits.c: we are legit * 2014 by true - * - * ---- - * - * $Id: menu_credits.c 350 2015-05-28 02:23:03Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_credits.h b/fw_dc22_stm32l100/src/menu/menu_credits.h index da85959..3e5f738 100644 --- a/fw_dc22_stm32l100/src/menu/menu_credits.h +++ b/fw_dc22_stm32l100/src/menu/menu_credits.h @@ -1,15 +1,10 @@ /** * menu_credits.h: we are a pirates * 2014 by true - * - * ---- - * - * $Id: menu_credits.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_MENU_CREDITS_H -#define __PIRATE_MENU_CREDITS_H +#ifndef __MENU_MENU_CREDITS_H +#define __MENU_MENU_CREDITS_H @@ -18,4 +13,4 @@ extern const MenuItem menu_cred_ritem[]; -#endif +#endif /* __MENU_MENU_CREDITS_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_program.c b/fw_dc22_stm32l100/src/menu/menu_program.c index 96991f9..5dc1477 100644 --- a/fw_dc22_stm32l100/src/menu/menu_program.c +++ b/fw_dc22_stm32l100/src/menu/menu_program.c @@ -1,11 +1,6 @@ /** * menu_program.c: led and lcd program selection and configuration * 2014 by true - * - * ---- - * - * $Id: menu_program.c 368 2015-06-16 06:49:48Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_program.h b/fw_dc22_stm32l100/src/menu/menu_program.h index 0985316..ad52d8c 100644 --- a/fw_dc22_stm32l100/src/menu/menu_program.h +++ b/fw_dc22_stm32l100/src/menu/menu_program.h @@ -1,15 +1,10 @@ /** * menu_program.h: led and lcd program selection and configuration * 2014 by true - * - * ---- - * - * $Id: menu_program.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_MENU_PROGRAM_H -#define __PIRATE_MENU_PROGRAM_H +#ifndef __MENU_MENU_PROGRAM_H +#define __MENU_MENU_PROGRAM_H @@ -54,4 +49,4 @@ void menu_btntype_program(); -#endif +#endif /* __MENU_MENU_PROGRAM_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_radio.c b/fw_dc22_stm32l100/src/menu/menu_radio.c index 2bedeb6..780c401 100644 --- a/fw_dc22_stm32l100/src/menu/menu_radio.c +++ b/fw_dc22_stm32l100/src/menu/menu_radio.c @@ -1,11 +1,6 @@ /** * menu_radio.c: cool radio tricks * 2015 by true - * - * ---- - * - * $Id$ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_radio.h b/fw_dc22_stm32l100/src/menu/menu_radio.h index e5678fb..4cfff08 100644 --- a/fw_dc22_stm32l100/src/menu/menu_radio.h +++ b/fw_dc22_stm32l100/src/menu/menu_radio.h @@ -1,15 +1,10 @@ /** * menu_radio.h: cool radio tricks * 2015 by true - * - * ---- - * - * $Id$ - * **/ -#ifndef __PIRATE_MENU_RADIO_H -#define __PIRATE_MENU_RADIO_H +#ifndef __MENU_MENU_RADIO_H +#define __MENU_MENU_RADIO_H @@ -26,4 +21,4 @@ extern const MenuItem menu_comm_ritem[]; -#endif +#endif /* __MENU_MENU_RADIO_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_sensors.c b/fw_dc22_stm32l100/src/menu/menu_sensors.c index 40b9c9b..485aa64 100644 --- a/fw_dc22_stm32l100/src/menu/menu_sensors.c +++ b/fw_dc22_stm32l100/src/menu/menu_sensors.c @@ -1,11 +1,6 @@ /** * menu_sensors.c: sensors menu * 2014 by true - * - * ---- - * - * $Id: menu_sensors.c 350 2015-05-28 02:23:03Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_sensors.h b/fw_dc22_stm32l100/src/menu/menu_sensors.h index 9d51a10..951c83e 100644 --- a/fw_dc22_stm32l100/src/menu/menu_sensors.h +++ b/fw_dc22_stm32l100/src/menu/menu_sensors.h @@ -1,15 +1,10 @@ /** * menu_sensors.h: sensors menu * 2014 by true - * - * ---- - * - * $Id: menu_sensors.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_MENU_SENSORS_H -#define __PIRATE_MENU_SENSORS_H +#ifndef __MENU_MENU_SENSORS_H +#define __MENU_MENU_SENSORS_H @@ -30,4 +25,4 @@ extern const MenuItem menu_sens_ritem[]; -#endif +#endif /* __MENU_MENU_SENSORS_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_settings.c b/fw_dc22_stm32l100/src/menu/menu_settings.c index 265c991..06638c4 100644 --- a/fw_dc22_stm32l100/src/menu/menu_settings.c +++ b/fw_dc22_stm32l100/src/menu/menu_settings.c @@ -1,11 +1,6 @@ /** * menu_settings.c: setting shit up for pirates since * 2014 by true - * - * ---- - * - * $Id: menu_settings.c 375 2015-07-06 02:52:40Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_settings.h b/fw_dc22_stm32l100/src/menu/menu_settings.h index b4b1dbe..8f87d60 100644 --- a/fw_dc22_stm32l100/src/menu/menu_settings.h +++ b/fw_dc22_stm32l100/src/menu/menu_settings.h @@ -1,15 +1,10 @@ /** * menu_settings.h: setting shit up for pirates since * 2014 by true - * - * ---- - * - * $Id: menu_settings.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_MENU_SETTINGS_H -#define __PIRATE_MENU_SETTINGS_H +#ifndef __MENU_MENU_SETTINGS_H +#define __MENU_MENU_SETTINGS_H @@ -54,4 +49,4 @@ void settings_restore(uint8_t load_defaults); -#endif +#endif /* __MENU_MENU_SETTINGS_H */ diff --git a/fw_dc22_stm32l100/src/menu/menu_settings_defprog.h b/fw_dc22_stm32l100/src/menu/menu_settings_defprog.h index e76e63c..2ba1e3c 100644 --- a/fw_dc22_stm32l100/src/menu/menu_settings_defprog.h +++ b/fw_dc22_stm32l100/src/menu/menu_settings_defprog.h @@ -1,9 +1,6 @@ /** * menu_settings_defprog.h: firmware default LED programs * 2014 by true - * - * $Id: menu_settings_defprog.h 375 2015-07-06 02:52:40Z true $ - * **/ /* SKULL */ diff --git a/fw_dc22_stm32l100/src/menu/menu_testing.c b/fw_dc22_stm32l100/src/menu/menu_testing.c index 8b4d39e..0afdb93 100644 --- a/fw_dc22_stm32l100/src/menu/menu_testing.c +++ b/fw_dc22_stm32l100/src/menu/menu_testing.c @@ -1,11 +1,6 @@ /** * menu_testing.c: test menu and testing functions * 2014 by true - * - * ---- - * - * $Id: menu_testing.c 350 2015-05-28 02:23:03Z true $ - * **/ #include diff --git a/fw_dc22_stm32l100/src/menu/menu_testing.h b/fw_dc22_stm32l100/src/menu/menu_testing.h index cac4884..712aa17 100644 --- a/fw_dc22_stm32l100/src/menu/menu_testing.h +++ b/fw_dc22_stm32l100/src/menu/menu_testing.h @@ -1,15 +1,10 @@ /** * menu_testing.h: test menu and testing functions * 2014 by true - * - * ---- - * - * $Id: menu_testing.h 327 2015-02-18 04:43:42Z true $ - * **/ -#ifndef __PIRATE_MENU_TESTING_H -#define __PIRATE_MENU_TESTING_H +#ifndef __MENU_MENU_TESTING_H +#define __MENU_MENU_TESTING_H @@ -18,4 +13,4 @@ extern const MenuItem menu_test_ritem[]; -#endif +#endif /* __MENU_MENU_TESTING_H */ diff --git a/fw_dc22_stm32l100/src/pirate.c b/fw_dc22_stm32l100/src/pirate.c index d821ef0..87e4846 100644 --- a/fw_dc22_stm32l100/src/pirate.c +++ b/fw_dc22_stm32l100/src/pirate.c @@ -1,11 +1,6 @@ /** * pirate.c: yarrrgh mateys miscellaneous shit and system-wide common crap * 2014 by true - * - * ---- - * - * $Id: pirate.c 505 2021-09-05 19:07:51Z true $ - * **/ @@ -13,16 +8,15 @@ #include "device/attiny.h" #include "device/lcd.h" -#include "display/cgram/cgram.h" -uint8_t temperature; // pirate.h -int8_t temperature_cal; // pirate.h -uint8_t light_level; // pirate.h -uint8_t light_gain; // pirate.h +uint8_t temperature; // pirate.h +int8_t temperature_cal; // pirate.h +uint8_t light_level; // pirate.h +uint8_t light_gain; // pirate.h uint16_t mic_peak; // pirate.h -uint8_t dc23_nametx; +uint8_t dc23_nametx; PirateSettings settings; @@ -32,6 +26,7 @@ PirateSettings settings; * CEASE ALL OPERATIONS * note: we still consume ~7mA like this, probably because of circuit design fuckup ********/ +#include "display/cgram/icons.h" void pirate_shutdown(uint16_t type) { int i;