Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PSU-POWERLOGGER by
Diff: HEADERS/System.h
- Revision:
- 0:d0c18e423b13
- Child:
- 1:871a329fd172
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HEADERS/System.h Tue Sep 18 18:35:23 2012 +0000
@@ -0,0 +1,61 @@
+#ifndef _SYSTEM_H
+#define _SYSTEM_H
+
+#include "DataTypes.h"
+#include "mbed.h"
+#include "Serial.h"
+#include "ADC.h"
+#include "Configuration.h"
+#include "stdio.h"
+#include "FixedMath.h"
+#include "KeyValue.h"
+#include "SmartSwitch.h"
+#include "GFX.h"
+#include "ff.h"
+#include "FIRMWARE_VERSION.h"
+#include "Terminal.h"
+
+#define SYSTEM_STATE_INIT 0
+#define SYSTEM_STATE_LOGGING 1
+#define SYSTEM_STATE_IDLE 2
+
+void EnterSystemState(BYTE NextState);
+void InitButton();
+void InitRobotPowerMeasurementSystem();
+
+void CheckButton();
+void UpdateDisplay();
+void CheckSDCardStatus();
+void UpdateHostTerminal();
+
+extern BYTE SystemState;
+
+#define DATA_BLOCK_SIZE 1024
+
+typedef struct {
+
+ float Voltage[DATA_BLOCK_SIZE];
+ float Current[DATA_BLOCK_SIZE];
+
+ SIGNED_DWORD WriteOutPtr;
+ SIGNED_DWORD ReadInPtr;
+
+}DataBlock;
+
+extern DataBlock MyDataBlock;
+extern SIGNED_DWORD ReadWriteDifferential;
+
+#define MIN_WRITE_BLOCK_THRESH (16)
+#define MAX_WRITE_BLOCK_THRESH ((DATA_BLOCK_SIZE/2)-1)
+
+void InitDataBlocks(DataBlock * DB);
+extern BOOL DataLogError;
+extern CHAR *ErrorMsg;
+void LogData();
+void DisplayBootMsg();
+
+extern time_t CurrentTime_InSec;
+extern tm *CurrentTime;
+
+#endif
+
