void main(void) { uchar lst1; nop(); nop(); main_1: ini_ram(); //RAM初始化,主要写入0外的数据 ini_pp(); //端口及外围功能初始化 lst1=200; for(;;) { main_2: emi_p(); main_6: RESET_WATCHDOG(); if (!mflg10ms) goto main_2; mflg10ms=0; lst1++; if (!buzstp) { if (lst1>=200) { // btMusicSet=MFSELF; // music_sel_ts_flg=1; btMusicSet=8; buzstp=1; } } else lst1=0; Music_Select(); Musicing(); } }
void load_config() { char *value; char msg[100]; msg[0] = 0; /* ini_r is a structure that holds state to make this reader * reentrant */ struct read_ini *ini_r = NULL; /* "test.ini" will be parsed into "ini" */ char* root = (*SYS_RootDir)(); char filename[100]; filename[0] = 0; strcat(filename, root); strcat(filename, "\\PlugIns\\"); strcat(filename, "saveall.ini"); struct ini *ini = read_ini(&ini_r, filename); /* pretty printing of ini structure */ ini_pp(ini); /* retrieve a value */ value = ini_get_value(ini, "section", "basedir"); if(value != NULL) { strcat(msg, "value is\n"); strcat(msg, value); strcpy(basedir, value); // ShowMessage(msg); } else { // ShowMessage("cannot get key"); } /* free memory */ destroy_ini(ini); cleanup_readini(ini_r); }