void start_client(void) { extern char currmaildir[]; initialize_mdb(); #ifndef ENABLE_SSH initialize_db(); #endif initialize_convert_env(); system_init(); if (setjmp(byebye)) { system_abort(); } strlcpy(BoardName, BBSNAME, sizeof(BoardName)); if (login_query() == -1) { terminal_flush(); sleep(3); exit(1); } #ifndef ENABLE_SSH screen_negotiate_size(); #endif // ENABLE_SSH screen_init(0); user_login(); setmdir(currmaildir, currentuser.userid); RMSG = NA; screen_clear(); editor_restore(); #ifdef TALK_LOG tlog_recover(); #endif if (strcmp(currentuser.userid, "guest")) { if (check_maxmail()) pressanykey(); screen_move(9, 0); screen_clrtobot(); if (!DEFINE(DEF_NOLOGINSEND)) if (session_visible()) login_msg(); screen_clear(); set_numofsig(); } active_board_init(false); fill_date(); if (DEFINE(DEF_LOGFRIEND) && session_count_online_followed(!HAS_PERM(PERM_SEECLOAK)) > 0) show_online_followings(); menu_load("menu.img"); while (1) { if (DEFINE(DEF_NORMALSCR)) menu_loop("TOPMENU"); else menu_loop("TOPMENU2"); Goodbye(); } }
void editorShow(unsigned char emode) { //char s[3]; uint8_t show_updown=1; uint8_t noexit=0; char inp[12]; switch(emode) { case 1: editor_baudrate(&BAUDRATE); if (editor_changed==1) lcd_clear(); if (editor_changed==1) fprintf(editor_LCD, "\fBAUDRATE \n = %ld ", BAUDRATE); break; case 2: editor_uint8_turn(&T_INPUT, 0, 2, 1, 1); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fINPUT \n = "); if (T_INPUT==0) { lcd_pos_string(3,2,"T0"); } else if (T_INPUT==1) { lcd_pos_string(3,2,"T1"); } else if (T_INPUT==2) { lcd_pos_string(3,2,"(T0+T1)/2"); } } break; case 3: editor_int16(&PT100_OFFSET0, -1000, 1000, 1, 10); sprintf(inp, "%4d", PT100_OFFSET0); to_decimal(inp, 1); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPT100 OFFSET for T0 \n = %s °C ", inp); } sprintf(inp, "%4d", PT1002T(read_adc(1,16), PT100_OFFSET0)); to_decimal(inp, 1); fprintf(editor_LCD, "\vT0=%s°C ", inp); break; case 4: editor_int16(&PT100_OFFSET1, -1000, 1000, 1, 10); sprintf(inp, "%4d", PT100_OFFSET1); to_decimal(inp, 1); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPT100 OFFSET for T1 \n = %s °C ", inp); } sprintf(inp, "%4d", PT1002T(read_adc(0,16), PT100_OFFSET1)); to_decimal(inp, 1); fprintf(editor_LCD, "\vT1=%s°C ", inp); break; case 5: editor_int16(&PID_P, 0, 1000, 1, 10); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPID P factor \n = %d ", PID_P); } break; case 6: editor_int16(&PID_I, 0, 1000, 1, 10); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPID I factor \n = %d ", PID_I); } break; case 7: editor_int16(&PID_D, 0, 1000, 1, 10); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPID D factor \n = %d ", PID_D); } break; case 8: editor_int32(&PID_IMAX, 0, 1000000, 1, 10); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fPID I_MAX \n = %ld ", PID_IMAX); } break; case 9: editor_uint16(&FAN_MIN, 0, 100, 1, 2); if (editor_changed==1) { lcd_clear(); fprintf(editor_LCD, "\fFAN START TEMP. \n = %d °C ", FAN_MIN); } break; case 10: editor_int16(&FAN_INCREASE, 0, 100, 1, 2); if (editor_changed==1) { lcd_clear(); sprintf(inp, "%4d", FAN_INCREASE); to_decimal(inp, 1); fprintf(editor_LCD, "\fFAN INCREASE \n = %s steps/°C ", inp); } break; case EDITOR_MAXMODE-1: editor_restore(); show_updown=0; if (editor_changed==1) lcd_clear(); if (editor_changed==1) fprintf(editor_LCD, "\frestore defeault \npress %c ", EDITOR_ACCEPT_GLYPH); noexit=1; break; case EDITOR_MAXMODE: editor_quit(); show_updown=0; if (editor_changed==1) lcd_clear(); if (editor_changed==1) fprintf(editor_LCD, "\fDONE !!! \npress %c ", EDITOR_ACCEPT_GLYPH); noexit=1; break; } if (noexit!=1) editor_quit(); //if (emode<EDITOR_MAXMODE-1) { if (show_updown==0) { lcd_pos_char(7,4,' '); lcd_pos_char(12,4,' '); } else { lcd_pos_char(7,4,EDITOR_DOWN_GLYPH); lcd_pos_char(12,4,EDITOR_UP_GLYPH); } lcd_pos_char(2,4,EDITOR_ENTER_GLYPH); lcd_pos_char(17,4,EDITOR_ACCEPT_GLYPH); /*} else { lcd_pos_char(10,3,EDITOR_ENTER_GLYPH); lcd_pos_char(2,3,EDITOR_ACCEPT_GLYPH); }*/ editor_changed=0; };