int main(void) { uint8_t taste =0; uint8_t war_taste =0; int16_t color =255; ws2803_init(); DDRB &=~(1<<2); PORTB |=(1<<2); //plasma_init_palette(); while(1) { draw(); if((~PINB & (1<<2))) { //taste gedrückt ? if(taste ==0) { /*if(color <=0) { color =255; taste =1; }*/ taste =1; } } else { //taste losgelassen taste =0; war_taste =0; } if(taste && !war_taste) { pos_x++; if(pos_x ==SCREEN_WIDTH) { pos_x =0; pos_y++; } if(pos_y ==SCREEN_HEIGHT) pos_y =0; war_taste =1; } /*if(color >0) { screen_setPixel(4, 0, color, color, color); color -=10; } else color =0;*/ screen_show(); _delay_ms(30); } return 0; }
void pars_newtopic(void) { if (config->packet_qchat) { strncpy(status->chnl[0].topic, packet, STR_SIZE); snprintf(message, MSG_SIZE, PARS_QTOPIC, time_get()); #ifdef TCP write_tcp(status->room->name); #endif /* TCP */ if (config->verbose) { write_log(config->log_main); write_str(status->room->name, COL_SYSTEM); } /* SERGEJ */ validate_string(status->chnl[0].topic); snprintf(message, MSG_SIZE, "%s\n", status->chnl[0].topic); #ifdef TCP write_tcp(status->room->name); #endif /* TCP */ if (config->verbose) { write_log(config->log_main); write_str(status->room->name, COL_SYSTEM); } } else { strncpy(status->channel, packet, CHANNEL_MAXLEN); if (strncmp(status->chnl[0].name, status->channel, CHANNEL_MAXLEN) && !chnl_getnum()) return; strncpy(status->chnl[chnl_getnum()].topic, pars_word(), STR_SIZE); snprintf(message, MSG_SIZE, PARS_TOPIC, time_get(), status->channel); #ifdef TCP write_tcp(status->channel); #endif /* TCP */ if (config->verbose) { write_log(config->log_main); write_str(status->channel, COL_SYSTEM); } /* SERGEJ */ validate_string(status->chnl[chnl_getnum()].topic); snprintf(message, MSG_SIZE, "%s\n", status->chnl[chnl_getnum()].topic); #ifdef TCP write_tcp(status->channel); #endif /* TCP */ if (config->verbose) { write_log(config->log_main); write_str(status->channel, COL_SYSTEM); } } refresh_room(); screen_show(); refresh_input(); string_show(); if ((!config->my_only || !strncmp(status->room->name, status->channel, CHANNEL_MAXLEN)) && (config->mode == MOD_NORMAL)) beep_system(); }
void pars_topic(void) { if (strncmp(config->nick, packet, NICK_MAXLEN)) return; if (config->packet_qchat) { if (!strncmp(status->chnl[0].topic, pars_word(), STR_SIZE)) return; strncpy(status->chnl[0].topic, packet, STR_SIZE); snprintf(message, MSG_SIZE, PARS_QTOPICC, time_get()); #ifdef TCP write_tcp(status->room->name); #endif /* TCP */ write_log(config->log_main); write_str(status->room->name, COL_SYSTEM); /* SERGEJ */ validate_string(status->chnl[0].topic); snprintf(message, MSG_SIZE, "%s\n", status->chnl[0].topic); #ifdef TCP write_tcp(status->room->name); #endif /* TCP */ write_log(config->log_main); write_str(status->room->name, COL_SYSTEM); } else { strncpy(status->channel, pars_word(), CHANNEL_MAXLEN); if (!strncmp(status->room->topic, pars_word(), STR_SIZE)) return; strncpy(status->chnl[chnl_getnum()].topic, packet, STR_SIZE); snprintf(message, MSG_SIZE, PARS_TOPICC, time_get(), status->channel); #ifdef TCP write_tcp(status->channel); #endif /* TCP */ write_log(config->log_main); write_str(status->channel, COL_SYSTEM); /* SERGEJ */ validate_string(status->chnl[chnl_getnum()].topic); snprintf(message, MSG_SIZE, "%s\n", status->chnl[chnl_getnum()].topic); #ifdef TCP write_tcp(status->channel); #endif /* TCP */ write_log(config->log_main); write_str(status->channel, COL_SYSTEM); } refresh_room(); screen_show(); refresh_input(); string_show(); }
void pars_nick(void) { strncpy(status->channel, packet, NICK_MAXLEN); strncpy(status->nick, pars_word(), NICK_MAXLEN); if (!config->packet_qchat) { pars_word(); status->gender = pars_number(); } user_nick(); chat_nick(); if (user_ignore()) return; snprintf(message, MSG_SIZE, PARS_NICK, time_get(), status->channel, status->nick); #ifdef TCP write_tcp(status->chnl[0].name); #endif /* TCP */ if (!user_ignore() && config->verbose) { write_log(config->log_main); write_str(status->chnl[0].name, COL_SYSTEM); } refresh_room(); screen_show(); refresh_input(); string_show(); if ((!config->my_only || !strncmp(status->room->name, status->channel, CHANNEL_MAXLEN)) && (config->mode == MOD_NORMAL)) beep_system(); }
void user_mode(void) { status->user[user_getnum()].mode = status->mode; refresh_room(); screen_show(); user_refresh(); }
static void back_click_handler(ClickRecognizerRef recognizer, void *context) { window_stack_remove(s_main_window, true); screen_show(s_screen); }