some Init-Stuff optimized and made Log nicer
This commit is contained in:
		| @@ -90,7 +90,7 @@ const configData_t ConfigData_defaults = { | |||||||
|     0 // checksum |     0 // checksum | ||||||
| }; | }; | ||||||
|  |  | ||||||
| void InitEEPROM(); | boolean InitEEPROM(); | ||||||
| void EEPROM_Process(); | void EEPROM_Process(); | ||||||
| void StoreConfig_EEPROM(); | void StoreConfig_EEPROM(); | ||||||
| void GetConfig_EEPROM(); | void GetConfig_EEPROM(); | ||||||
|   | |||||||
| @@ -35,12 +35,13 @@ boolean checkEEPROMavailable(); | |||||||
|  * |  * | ||||||
|  * This function initializes the EEPROM using the I2C_eeprom instance and checks if it's available. |  * This function initializes the EEPROM using the I2C_eeprom instance and checks if it's available. | ||||||
|  */ |  */ | ||||||
| void InitEEPROM() | boolean InitEEPROM() | ||||||
| { | { | ||||||
|  |   Wire.begin(); | ||||||
|   ConfigData = ConfigData_defaults; |   ConfigData = ConfigData_defaults; | ||||||
|   PersistenceData = {0}; |   PersistenceData = {0}; | ||||||
|   ee.begin(); |   ee.begin(); | ||||||
|   checkEEPROMavailable(); |   return checkEEPROMavailable(); | ||||||
| } | } | ||||||
|  |  | ||||||
| /** | /** | ||||||
|   | |||||||
| @@ -110,13 +110,19 @@ void setup() | |||||||
|  |  | ||||||
| 	Serial.print("\n\n-------------------START-------------------\n"); | 	Serial.print("\n\n-------------------START-------------------\n"); | ||||||
| 	Serial.print(globals.DeviceNameId); | 	Serial.print(globals.DeviceNameId); | ||||||
| 	Serial.print("\nby Hiabuto Defense\n"); | 	Serial.print("\nby Hiabuto Defense\n\n"); | ||||||
|  |  | ||||||
| 	// Initialize EEPROM, load configuration, and persistence data from EEPROM | 	// Initialize EEPROM, load configuration, and persistence data from EEPROM | ||||||
| 	InitEEPROM(); | 	if (InitEEPROM()) | ||||||
| 	GetConfig_EEPROM(); | 	{ | ||||||
| 	GetPersistence_EEPROM(); | 		GetConfig_EEPROM(); | ||||||
| 	Serial.print("\nEE-Init done"); | 		GetPersistence_EEPROM(); | ||||||
|  | 		Serial.printf("Initialized EEPROM at Address 0x%02X\n", I2C_EE_ADDRESS); | ||||||
|  | 	} | ||||||
|  | 	else | ||||||
|  | 	{ | ||||||
|  | 		Serial.print("EEPROM not Initialized\n"); | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	if (i2c_io.begin()) | 	if (i2c_io.begin()) | ||||||
| 	{ | 	{ | ||||||
| @@ -209,7 +215,6 @@ void setup() | |||||||
|  |  | ||||||
| 	// Start cyclic EEPROM updates for Persistence Data Structure (PDS) | 	// Start cyclic EEPROM updates for Persistence Data Structure (PDS) | ||||||
| 	tmrEEPROMCyclicPDS.start(); | 	tmrEEPROMCyclicPDS.start(); | ||||||
| 	Serial.print("\nSetup Done\n"); |  | ||||||
|  |  | ||||||
| 	disp_FAC_1.init(); | 	disp_FAC_1.init(); | ||||||
| 	disp_FAC_1.setBrightness(5); | 	disp_FAC_1.setBrightness(5); | ||||||
| @@ -218,7 +223,6 @@ void setup() | |||||||
| 	disp_FAC_3.init(); | 	disp_FAC_3.init(); | ||||||
| 	disp_FAC_3.setBrightness(5); | 	disp_FAC_3.setBrightness(5); | ||||||
|  |  | ||||||
| 	tmrEEPROMCyclicPDS.start(); |  | ||||||
| 	tmrFactionTicker.start(); | 	tmrFactionTicker.start(); | ||||||
| 	tmrInputGetter.start(); | 	tmrInputGetter.start(); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user