Refactor dds into dds and fgen
driver module started
This commit is contained in:
@@ -9,9 +9,11 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
//Application includes
|
||||
#include "eeprom.h"
|
||||
#include "soft_timer.h"
|
||||
#include "System/system.h"
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -72,5 +74,38 @@ SYSTEM_DATA_t* system_getSys(void)
|
||||
// call from the main timer at 100Hz
|
||||
void system_monitor(void)
|
||||
{
|
||||
// system level monitoring in timer ISR
|
||||
}
|
||||
|
||||
void system_init(void)
|
||||
{
|
||||
memset(&sys, 0, sizeof(SYSTEM_DATA_t));
|
||||
|
||||
sys.systemTime = 0;
|
||||
sys.safeMode = false;
|
||||
sys.usbConnected = false;
|
||||
sys.guiMode = GUI_MODE_NORMAL;
|
||||
sys.activeAccessory = NULL;
|
||||
sys.nextAccessory = NULL;
|
||||
sys.maxPowerLimit = POWER_LIMIT_ALKALINE; // default until battery type determined.
|
||||
|
||||
|
||||
char *ver = SW_VERSION;
|
||||
|
||||
for (int i=0; i < strlen(ver); ++i)
|
||||
{
|
||||
if (isalpha(ver[i]))
|
||||
{
|
||||
sys.isBeta = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
stimer_init();
|
||||
|
||||
sys.h100HzTimer = stimer_start( 10, TIMER_MODE_PERIODIC, NULL, NULL);
|
||||
sys.h10HzTimer = stimer_start( 100, TIMER_MODE_PERIODIC, NULL, NULL);
|
||||
sys.h1HzTimer = stimer_start(1000, TIMER_MODE_PERIODIC, NULL, NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
#define POWER_LIMIT_ALKALINE 5.0f
|
||||
#define POWER_LIMIT_EXT_DC 10.0f
|
||||
|
||||
#define FREQ_MAX_NUM 50 //Max number of frequencies allowed
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GUI_MODE_NORMAL = 0,
|
||||
@@ -45,8 +47,6 @@ typedef struct ClampData_s
|
||||
} ClampData_t;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum
|
||||
{ USB_CONNECTED = 0,
|
||||
SAFE_MODE,
|
||||
@@ -91,11 +91,18 @@ typedef struct
|
||||
|
||||
bool status[NUM_STATUS_FLAGS];
|
||||
|
||||
bool isBeta;
|
||||
|
||||
int hSysCheckTimer;
|
||||
int hOneSecondTimer;
|
||||
int h1HzTimer;
|
||||
int h10HzTimer;
|
||||
int h100HzTimer;
|
||||
|
||||
char tmpString[64];
|
||||
|
||||
// TODO: change to FREQUENCY_t*
|
||||
uint32_t frequency;
|
||||
|
||||
} SYSTEM_DATA_t;
|
||||
|
||||
|
||||
@@ -104,5 +111,6 @@ uint32_t SYS_GetLanguage(void);
|
||||
SYSTEM_DATA_t* system_getSys(void);
|
||||
|
||||
void system_monitor(void);
|
||||
void system_init(void);
|
||||
|
||||
#endif /* SYSTEM_SYSTEM_H_ */
|
||||
|
||||
Reference in New Issue
Block a user