Chau Vo / device_configuration

Dependents:   F103-Web-Server

Fork of my_eeprom_funcs by Chau Vo

Revision:
15:126b1eb74709
Parent:
14:17a44517b13d
--- a/my_eeprom_funcs.cpp	Thu Jun 16 21:43:32 2016 +0000
+++ b/my_eeprom_funcs.cpp	Thu Jun 16 21:51:03 2016 +0000
@@ -258,8 +258,23 @@
 }
 
 /*!
- * Function to disable the flag indicates a static IP address has been assigned
+ * Function to enable/disable the flag indicates a static IP address has been assigned
  */
+void set_conf() {
+    DBG("Enable device configured flag...");
+    
+    // Unlock the Flash Program Erase controller */
+    FLASH_Unlock();
+    // EEPROM Init
+    EE_Init();
+     
+    // erase first_run flag
+    EE_WriteVariable(VirtAddVarTab[CONFIGURED_IP_FLAG_POS], DEFAULT_ENABLE_FLAG_VALUE);
+    
+    FLASH_Lock();
+    
+    DBG("Successful");
+}
 void reset_conf() {
     DBG("Disable device configured flag...");