RINGING_END_ANON_NAMESPACE int display_columns() { static int val = init_columns(); return val; }
short load_level_file(LevelNumber lvnum) { char *fname; short fgroup; short result; fgroup = get_level_fgroup(lvnum); fname = prepare_file_fmtpath(fgroup,"map%05lu.slb",(unsigned long)lvnum); wait_for_cd_to_be_available(); if (LbFileExists(fname)) { result = true; load_map_data_file(lvnum); load_map_flag_file(lvnum); load_column_file(lvnum); init_whole_blocks(); load_slab_file(); init_columns(); load_static_light_file(lvnum); if (!load_map_ownership_file(lvnum)) result = false; load_map_wibble_file(lvnum); load_and_setup_map_info(lvnum); load_texture_map_file(game.texture_id, 2); load_action_point_file(lvnum); if (!load_map_slab_file(lvnum)) result = false; if (!load_thing_file(lvnum)) result = false; reinitialise_map_rooms(); ceiling_init(0, 1); } else { ERRORLOG("The level \"map%05lu\" doesn't exist; creating empty map.",lvnum); init_whole_blocks(); load_slab_file(); init_columns(); game.texture_id = 0; load_texture_map_file(game.texture_id, 2); init_top_texture_to_cube_table(); result = false; } return result; }
/** * @brief Reports column of key that was pressed * @retval Int of column activated */ uint8_t get_column(void) { // Initialize pins to allow for columns as input init_columns(); // Row selection determined by active low if(!HAL_GPIO_ReadPin(GPIOD, col_pinmap[0])) return 0; else if(!HAL_GPIO_ReadPin(GPIOD, col_pinmap[1])) return 1; else if(!HAL_GPIO_ReadPin(GPIOD, col_pinmap[2])) return 2; else return 9; }
void keypad_mode(void) { osSemaphoreWait(keypad_semaphore, osWaitForever); switch (key_number){ case 1: DISPLAY_TEMP=1; DISPLAY_ACC =0; ACC_PITCH = 1; ACC_ROLL = 0; break; case 2: DISPLAY_TEMP=0; DISPLAY_ACC =1; ACC_PITCH = 1; ACC_ROLL = 0; break; case 3: DISPLAY_TEMP=0; DISPLAY_ACC =1; ACC_PITCH = 0; ACC_ROLL = 1; break; default: break; } rows_init(); if(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_5) == 0) { init_columns(); if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_13) == 0) { key_number = 1; } else if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_12) == 0) { key_number = 2; } else if(HAL_GPIO_ReadPin(GPIOB, GPIO_PIN_11) == 0) { key_number = 3; } printf("%d\n", key_number); } }
int main(int argc, char **argv) { if (argc != 3) { fprintf(stderr,"anno_setter <in.vcf.gz> <columns_string>\n"); return 1; } bcf_hdr_t *h = NULL; //bcf_hdr_init(); htsFile *fp = hts_open(argv[1], "r"); if (fp == NULL) error("%s : %s", argv[1], strerror(errno)); h = bcf_hdr_read(fp); if (h == NULL) error("failed to prase header"); bcf_hdr_t *out = bcf_hdr_dup(h); char *string = strdup(argv[2]); int ncols = 0; anno_col_t *cols = init_columns(string, h, out, &ncols, anno_is_vcf); print_anno_cols(cols, ncols); hts_close(fp); return 0; }