#define UNI_BUFFER_SIZE 36
-static union {
+static union __attribute__((packed)) {
uint8_t w8[UNI_BUFFER_SIZE];
uint16_t w16[UNI_BUFFER_SIZE/2];
uint32_t w32[UNI_BUFFER_SIZE/4];
volatile static uchar LED_state = 0xff; // received from PC
/* ------------------------------------------------------------------------- */
+static
void memory_clean(void) {
memset(secret, 0, 32);
secret_length_b = 0;
}
+static
uint8_t secret_set(void){
uint8_t r;
union {
return 0;
}
+static
void token_generate(void) {
percnt_inc(0);
eeprom_busy_wait();
memory_clean();
}
+static
void counter_reset(void) {
uint8_t reset_counter;
eeprom_busy_wait();
eeprom_write_byte(&reset_counter_ee, reset_counter + 1);
}
+static
void counter_init(void) {
eeprom_busy_wait();
if (eeprom_read_byte(&reset_counter_ee) == 0) {
percnt_init(0);
}
+static
void buildReport(uchar send_key) {
keyboard_report.modifier = 0;
}
}
-static inline
-int8_t button_get_debounced(uint8_t debounce_count) {
+static
+int8_t button_get_debounced(volatile uint8_t debounce_count) {
uint8_t v;
v = PINB & _BV(BUTTON_PIN);
while (debounce_count-- && v == (PINB & _BV(BUTTON_PIN))) {
return v ? 0 : 1;
}
+static
void init_temperature_sensor(void){
ADMUX = 0x8F;
ADCSRA = 0x87;
}
+static
uint16_t read_temperture_sensor(void){
ADCSRA |= 0x40;
while(ADCSRA & 0x40)