/*
 * SaveData.c
 *
 *  Created on: Feb 5, 2017
 *      Author: User
 */
#include "SaveData.h"

void SaveData(save_data_t *config)
{
	if(config->saveDataFlag == false)
	{
		return;
	}
	else
	{
		DS3231_ReadAll(&realTimeConfig);
		LTC3335_GetAccumCharge(&drvConfig);
		MCP9801_GetTemperature(&tempConfig);

		PRINTF("20%d-%d-%d\t%d:%d:%d\t%d\t%d\t%d.%d\t%d\r\n",
			realTimeConfig.year,
			realTimeConfig.month,
			realTimeConfig.date,
			realTimeConfig.hours,
			realTimeConfig.minutes,
			realTimeConfig.seconds,
			*(drvConfig.AccumulatedCharge),
			irqOldCount,
			tempConfig.hByteTemp,
			tempConfig.lByteTemp,
			drvConfig.InVoltage
			);
	}
	return;
}
