void FCharacterInfoDialog::updateProfile(FCharacter *c) { updateKeyValues(c->getProfileDataKeys(), c->getProfileData(), ui->profileTab); }
void FCharacterInfoDialog::updateKinks(FCharacter *c) { updateKeyValues(c->getCustomKinkDataKeys(), c->getCustomKinkData(), ui->kinkTab); }
int main(void) { PORTD = 0; DDRD = 0xff; // set power reduction register, disable everything we don't need PRR = (1 << PRTWI) | (1 << PRTIM1) | (1 << PRUSART0) | (1 << PRADC); DDRB = ~3; PORTB = 3; // pullups on PB0/PB1 DDRC = ~1; PORTC = 1; // pullups on PC0 PCMSK0 = (1 << PCINT1) | (1 << PCINT0); // enable interupt for these pins PCMSK1 = (1 << PCINT8); // enable interupt for these pins PCICR = (1 << PCIE0) | (1 << PCIE1); // PCIE0 enable pin interupt PCINT7..0. tick_init(); startShowHours(4 * TICK_SECOND); timer[delay_Second].callback = second_timer_callback; timer[delay_Update].callback = update_timer_callback; second_timer_callback(&timer[delay_Second]); // get started update_timer_callback(&timer[delay_Update]); // get started startTimer(); updateKeyValues(); keyState = lastKeyValue; SET_SRESET(); spi_init(); pwmInit(); sei(); for (;;) { /* main event loop */ /* If our internal ideal of which keys are down is different from the one that has been updated cia the interupts, we start counting. If the 'different' key(s) stays the same for 50ms, we declare it an 'event' and update the internsl key state */ if (keyState != lastKeyValue) { for (uint8_t ki = 0; ki < KEY_MAX; ki++) if ((keyState & (1 << ki)) != (lastKeyValue & (1 << ki))) { if (keyDebounce[ki] < 50) { keyDebounce[ki]++; if (keyDebounce[ki] == 50) { keyEvent |= (1 << ki); keyState = (keyState & ~(1 << ki)) | (lastKeyValue & (1 << ki)); } } } /* * if a Key changed state, let's check it out */ if (keyEvent) { if ((keyEvent & (1 << KEY_START)) && (keyState & (1 << KEY_START)) == 0) { if (!startTimer()) startShowHours(4 * TICK_SECOND); } if ((keyEvent & (1 << KEY_STOP)) && (keyState & (1 << KEY_STOP)) == 0) { if (!stopTimer()) startShowHours(4 * TICK_SECOND); } if ((keyEvent & (1 << KEY_RESET)) && (keyState & (1 << KEY_RESET)) == 0) { resetTimer(); } keyEvent = 0; updateTimerDisplay(); updateTimer(); } delay_ms(1); } else { sleep_mode(); } } return 0; }