From e205f4bbcaa943561bb079e81be3e0099eb917a6 Mon Sep 17 00:00:00 2001 From: Rene Hopf Date: Mon, 12 Sep 2016 18:00:28 +0200 Subject: [PATCH] rename stuff --- src/comps/term.comp | 18 +++++++++--------- src/hal_conf.c | 4 ++-- src/hal_conf.h | 4 ++-- src/hal_term.c | 12 ++++++------ src/hal_term.h | 10 +++++----- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/comps/term.comp b/src/comps/term.comp index 3598c574..9fbd92b5 100644 --- a/src/comps/term.comp +++ b/src/comps/term.comp @@ -64,7 +64,7 @@ MEM(volatile float jog_en) = 0.0; INIT( hal_conf_init(); - if(load()){//flash load error + if(hal_conf_load()){//flash load error hal.hal_state = CONFIG_LOAD_ERROR; } ); @@ -217,7 +217,7 @@ NRT( printf("done\n"); } else if(!strcmp(s, "hal")){ - print_hal_info(); + hal_term_print_info(); } else if(!strcmp(s, "about")){ about(); @@ -229,16 +229,16 @@ NRT( NVIC_SystemReset(); } else if(!strcmp(s, "list")){ - hal_term_listhal(); + hal_term_list(); } else if(!strcmp(s, "help")){ help(); } else if(!strcmp(s, "save")){ - save(); + hal_conf_save(); } else if(!strcmp(s, "load")){ - int ret = load(); + int ret = hal_conf_load(); if(ret == -1){ printf("flash error\n"); return; @@ -256,7 +256,7 @@ NRT( } } else if(!strcmp(s, "getconf")){ - hal_term_conf(); + hal_term_getconf(); } else if(!strcmp(s, "jogl")){ jog_en = -1.0; @@ -405,7 +405,7 @@ NRT( fault_sender(); if(EDGE(hal.hal_state)){ - hal_print_state(); + hal_term_print_state(); } int i = -1; @@ -415,12 +415,12 @@ NRT( } if(i == 2){ // read hal pin if(hal_is_pin(sink)){ - print_pin(hal_find_pin(sink)); + hal_term_print_pin(hal_find_pin(sink)); } else if(hal_is_compname(sink)){ for(int i = 0; i < hal.hal_pin_count; i++){//find all pins of this comp if(!strncmp(hal.hal_pins[i]->name, sink, strlen(sink))){ - print_pin(hal.hal_pins[i]); + hal_term_print_pin(hal.hal_pins[i]); } } }else{ diff --git a/src/hal_conf.c b/src/hal_conf.c index 7f94b372..d8d74c99 100644 --- a/src/hal_conf.c +++ b/src/hal_conf.c @@ -10,7 +10,7 @@ void hal_conf_init(){ FLASH_Lock(); } -void save(){ +void hal_conf_save(){ // if(ee_error != FLASH_COMPLETE){ // printf("flash error:%i\n",ee_error); // return; @@ -58,7 +58,7 @@ void save(){ printf("done\n"); } -int load(){ +int hal_conf_load(){ if(hal.rt_state != RT_STOP || hal.frt_state != FRT_STOP){ return(-4); } diff --git a/src/hal_conf.h b/src/hal_conf.h index f56c8b9b..1db20f99 100644 --- a/src/hal_conf.h +++ b/src/hal_conf.h @@ -4,6 +4,6 @@ #include "hal.h" #include "hal_conf.h" -void save(); -int load(); +void hal_conf_save(); +int hal_conf_load(); void hal_conf_init(); diff --git a/src/hal_term.c b/src/hal_term.c index 28ed7e32..f3d8d8b6 100644 --- a/src/hal_term.c +++ b/src/hal_term.c @@ -1,7 +1,7 @@ #include #include "hal_term.h" -void print_pin(hal_pin_t* pin){ +void hal_term_print_pin(hal_pin_t* pin){ if(pin == pin->source){//if pin is not linked printf("%s = %f\n", pin->name, pin->source->source->value); }else{//pin is linked @@ -9,14 +9,14 @@ void print_pin(hal_pin_t* pin){ } } -void hal_term_listhal(){ +void hal_term_list(){ for(int i = 0; i < hal.hal_pin_count; i++){ printf("%s <= %s = %f\n", hal.hal_pins[i]->name, hal.hal_pins[i]->source->name, hal.hal_pins[i]->source->source->value); Wait(1);//TODO: remove wait... } } -void hal_term_conf(){ +void hal_term_getconf(){ for(int i = 0; i < hal.hal_pin_count; i++){ char name[6]; strncpy(name,hal.hal_pins[i]->name,5); @@ -27,7 +27,7 @@ void hal_term_conf(){ } } -void hal_print_state(){ +void hal_term_print_state(){ switch(hal.hal_state){ case HAL_OK: printf("HAL state: HAL_OK\n"); @@ -53,7 +53,7 @@ void hal_print_state(){ } } -void print_hal_info(){ +void hal_term_print_info(){ printf("######## hal info ########\n"); printf("#pins %i\n", hal.hal_pin_count); printf("#comps %i\n", hal.comp_count); @@ -104,7 +104,7 @@ void print_hal_info(){ printf("frt state: CALC\n"); break; } - hal_print_state(); + hal_term_print_state(); uint32_t p = 0; printf("active rt funcs(%u):\n", hal.rt_func_count); for(int i = 0; i < hal.rt_func_count; i++){ diff --git a/src/hal_term.h b/src/hal_term.h index 1f1d5e26..1f5e8af6 100644 --- a/src/hal_term.h +++ b/src/hal_term.h @@ -3,8 +3,8 @@ #include #include "hal.h" -void print_pin(hal_pin_t* pin); -void print_hal_info(); -void hal_term_listhal(); -void hal_term_conf(); -void hal_print_state(); +void hal_term_print_pin(hal_pin_t* pin); +void hal_term_print_info(); +void hal_term_list(); +void hal_term_getconf(); +void hal_term_print_state();