5 Commits

2 changed files with 10 additions and 5 deletions

View File

@@ -17,11 +17,12 @@
* along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <reflow-controller/sd.h>
#include "fatfs/ff.h"
#include "fatfs/shimatta_sdio_driver/shimatta_sdio.h"
#include <stdint.h>
#include <string.h>
#include <helper-macros/helper-macros.h>
#include <reflow-controller/digio.h>
@@ -36,7 +37,8 @@ bool mount_sd_card_if_avail(FATFS *fs)
memset(fs, 0, sizeof(FATFS));
sdio_stop_clk();
inserted_counter = 0;
return false;
sd_card_mounted_state = false;
goto ret;
}
if (!sdio_check_inserted() && inserted_counter < 255)
@@ -47,12 +49,13 @@ bool mount_sd_card_if_avail(FATFS *fs)
res = f_mount(fs, "0:/", 1);
if (res == FR_OK) {
led_set(1, 1);
return true;
sd_card_mounted_state = true;
} else {
return false;
sd_card_mounted_state = false;
}
}
ret:
return sd_card_mounted_state;
}

View File

@@ -22,6 +22,7 @@
#include <reflow-controller/ui/gui-config.h>
#include <reflow-controller/ui/menu.h>
#include <reflow-controller/ui/lcd.h>
#include <reflow-controller/sd.h>
#include <reflow-controller/ui/rotary-encoder.h>
#include <reflow-controller/systick.h>
#include <reflow-controller/adc-meas.h>
@@ -789,7 +790,6 @@ static void gui_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_entr
if (entry_type != MENU_ENTRY_CONTINUE) {
menu_changed = true;
menu_display_clear(menu);
update_display_buffer(0, "Main Menu");
menu_ack_rotary_delta(menu);
if (entry_type == MENU_ENTRY_FIRST_ENTER) {
list.entry_names = root_entry_names;
@@ -800,6 +800,8 @@ static void gui_menu_root_entry(struct lcd_menu *menu, enum menu_entry_func_entr
}
}
update_display_buffer(0, sd_card_is_mounted() ? "Main Menu [SD]" : "Main Menu [--]");
push_button = menu_get_button_state(menu);
rot_delta = menu_get_rotary_delta(menu);