Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: sm_sections.cpp
- Revision:
- 6:ab9f3695633f
- Parent:
- 4:efa207509f63
- Child:
- 8:f23601373e8b
--- a/sm_sections.cpp Sun Sep 29 17:09:48 2019 +0000 +++ b/sm_sections.cpp Sun Sep 29 20:07:54 2019 +0000 @@ -1,6 +1,5 @@ #include "sm_sections.h" -s_Section* s_currentSection; s_Section s_section1; s_Section s_section2; @@ -11,7 +10,7 @@ d_ODOM_distFromSectionStart_m = 0.0; e_stateSections = STOPPED; - s_currentSection = NULL; + s_UTILS_currentSection = NULL; //section de départ @@ -38,12 +37,12 @@ E_STATE_SECTIONS e_next_state = e_stateSections; - pc.printf("\r\nUpdate Section\r\n"); + //pc.printf("\r\nUpdate Section\r\n"); if(b_UTILS_flag_button){ e_next_state = INIT_SECTION; } - else if(s_currentSection == NULL && e_stateSections != INIT_SECTION) { + else if(s_UTILS_currentSection == NULL && e_stateSections != INIT_SECTION) { e_next_state = STOPPED; } else { @@ -52,7 +51,7 @@ e_next_state = LOADING_SECTION; break; case RUNNING_SECTION: - if(d_ODOM_distFromSectionStart_m > s_currentSection->lng_section_m) { + if(d_ODOM_distFromSectionStart_m > s_UTILS_currentSection->lng_section_m) { e_next_state = LOADING_SECTION; } else if (b_UTILS_flag_emergency_stop){ e_next_state = STOPPED; @@ -62,14 +61,14 @@ } break; case LOADING_SECTION: - if(s_currentSection != NULL && !b_UTILS_flag_emergency_stop) { //la section a ete chargee dans sectionOutput + if(s_UTILS_currentSection != NULL && !b_UTILS_flag_emergency_stop) { //la section a ete chargee dans sectionOutput e_next_state = RUNNING_SECTION; } else { e_next_state=STOPPED; } break; case STOPPED: - if(s_currentSection != NULL) { + if(s_UTILS_currentSection != NULL) { e_next_state = RUNNING_SECTION; } else { return; @@ -84,16 +83,16 @@ } void output_sm_sections(){ - pc.printf("\r\n Output Section\r\n"); - if(s_currentSection !=NULL) { + //pc.printf("\r\n Output Section\r\n"); + if(s_UTILS_currentSection !=NULL) { switch (e_stateSections) { case INIT_SECTION: b_UTILS_flag_button = false; - s_currentSection = &s_section1; + s_UTILS_currentSection = &s_section1; case RUNNING_SECTION: break; case LOADING_SECTION: - s_currentSection=s_currentSection->nextSection; + s_UTILS_currentSection=s_UTILS_currentSection->nextSection; d_ODOM_distFromSectionStart_m = 0.0; break; case STOPPED: