changeset 248:a5b00817a60f

FCBM reset mode implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 10 May 2021 01:54:19 +0000
parents 12b20090b46a
children 00767f051056
files components/fcbm src/cs/drivers/drv_app/power/board/power.c src/cs/services/fcbm/fcbm_func_i.h src/cs/services/fcbm/fcbm_messages.c src/cs/services/fcbm/fcbm_reset_mode.c
diffstat 5 files changed, 54 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/components/fcbm	Sun May 09 21:04:52 2021 +0000
+++ b/components/fcbm	Mon May 10 01:54:19 2021 +0000
@@ -55,6 +55,7 @@
 cfile_plain $SRCDIR/fcbm_messages.c
 cfile_plain $SRCDIR/fcbm_phone_on.c
 cfile_plain $SRCDIR/fcbm_powerkey_if.c
+cfile_plain $SRCDIR/fcbm_reset_mode.c
 cfile_plain $SRCDIR/fcbm_send_msg.c
 cfile_plain $SRCDIR/fcbm_task.c
 cfile_plain $SRCDIR/fcbm_textout.c
--- a/src/cs/drivers/drv_app/power/board/power.c	Sun May 09 21:04:52 2021 +0000
+++ b/src/cs/drivers/drv_app/power/board/power.c	Mon May 10 01:54:19 2021 +0000
@@ -141,6 +141,9 @@
       /* In FreeCalypso start from reset is NOT the same as PWON! */
       rvf_send_trace("Start from reset",16, NULL_PARAM,
 		     RV_TRACE_LEVEL_DEBUG_LOW, LCC_USE_ID);
+      #if (MMI != 0)
+	fcbm_message_to_task(FCBM_START_RESET_MODE);
+      #endif
    }
 }
 
--- a/src/cs/services/fcbm/fcbm_func_i.h	Sun May 09 21:04:52 2021 +0000
+++ b/src/cs/services/fcbm/fcbm_func_i.h	Mon May 10 01:54:19 2021 +0000
@@ -14,6 +14,7 @@
 
 void fcbm_process_message(T_RV_HDR *msg_ptr);
 void fcbm_process_msg_chg_mode(void);
+void fcbm_process_msg_reset_mode(void);
 void fcbm_process_msg_phone_on(void);
 
 void fcbm_chg_periodic_timer(void);
--- a/src/cs/services/fcbm/fcbm_messages.c	Sun May 09 21:04:52 2021 +0000
+++ b/src/cs/services/fcbm/fcbm_messages.c	Mon May 10 01:54:19 2021 +0000
@@ -15,6 +15,9 @@
 	case FCBM_START_CHG_MODE:
 		fcbm_process_msg_chg_mode();
 		return;
+	case FCBM_START_RESET_MODE:
+		fcbm_process_msg_reset_mode();
+		return;
 	case FCBM_START_PHONE:
 		fcbm_process_msg_phone_on();
 		return;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cs/services/fcbm/fcbm_reset_mode.c	Mon May 10 01:54:19 2021 +0000
@@ -0,0 +1,46 @@
+/*
+ * In this module we are going to implement FCBM functions
+ * for the reset or miscellaneous boot mode.
+ */
+
+#include "rv/rv_general.h"
+#include "rvf/rvf_api.h"
+#include "rvm/rvm_use_id_list.h"
+#include "fcbm/fcbm_func_i.h"
+#include "fcbm/fcbm_life_cycle.h"
+#include "fcbm/fcbm_timer_i.h"
+#include "r2d/r2d.h"
+#include "r2d/r2d_blrr_api.h"
+
+extern char fcbm_prod_banner_string[];
+
+void fcbm_process_msg_reset_mode(void)
+{
+	if (fcbm_life_cycle_state != FCBM_STATE_INACTIVE) {
+		rvf_send_trace("FCBM got reset mode request in wrong state",
+				42, fcbm_life_cycle_state,
+				RV_TRACE_LEVEL_ERROR, FCBM_USE_ID);
+		return;
+	}
+	rvf_send_trace("Entering reset boot mode", 24, NULL_PARAM,
+			RV_TRACE_LEVEL_DEBUG_HIGH, FCBM_USE_ID);
+	fcbm_subscribe_kpd();
+	fcbm_display_init();
+	fcbm_display_line(0, fcbm_prod_banner_string);
+	fcbm_display_line(1, "Misc boot state");
+#ifdef LSCREEN
+	fcbm_display_line(3, "Long-press Power");
+	fcbm_display_line(4, "button to turn off,");
+#else
+	fcbm_display_line(3, "Long-press PWR");
+	fcbm_display_line(4, "button to OFF,");
+#endif
+	fcbm_display_line(5, "or send fc-tmsh");
+	fcbm_display_line(6, "phone-on command");
+	fcbm_display_line(7, "to boot phone.");
+	r2d_flush();
+	blrr_display_ctrl(BLRR_DISPLAY_CHG_BOOT);
+	rvf_start_timer(FCBM_TIMER_DSPL_OFF,
+			RVF_SECS_TO_TICKS(FCBM_DISPLAY_SECS), FALSE);
+	fcbm_life_cycle_state = FCBM_STATE_ACTIVE;
+}