rename stuff

This commit is contained in:
Rene Hopf
2016-09-12 18:00:28 +02:00
parent f3ecc325c9
commit e205f4bbca
5 changed files with 24 additions and 24 deletions
+9 -9
View File
@@ -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{
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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();
+6 -6
View File
@@ -1,7 +1,7 @@
#include <stdio.h>
#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++){
+5 -5
View File
@@ -3,8 +3,8 @@
#include <string.h>
#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();