/*! **********************************************************************
 * Function: initialiseMenu(void)
 *
 * \brief Initialises the menu system
 *
 * Include: Menusystem.h
 *
 * Description: initialises the menu system so that it is fully operational
 *
 * Arguments: A pointer to the global tracking state
 *
 * Returns: None
 *************************************************************************/
void initialiseMenu(systemState *state) {
    m_userMode = REMOTE;
    configureSerial();
    //@TODO WHILE UNPLUGGED configLCD();
    configUSER();
    setMenu(topMenu);
    m_trackingState = state;

    RawRange;// = {RANGE_RAW, rawRangeStr, rawRangeTitle, 0, 0, 0, dispSerialMessage, noFunctionNumeric, noFunctionNumeric, returnToRngMenu};
    RawRange.confirmFunction = noFunctionNumeric;
            RawRange.menuID = RANGE_RAW;
    RawRange.serialMessage = rawRangeStr;
    RawRange.lcdTitleMessage = rawRangeTitle;
    RawRange.minVal = 0;
    RawRange.maxVal = 0;
    RawRange.increment = 0;
    RawRange.serialDisplayFunction = dispSerialMessage;
    RawRange.returnToPrevious = returnToRngMenu;
    RawRange.lcdDisplayFunction = noFunctionNumeric;

    calibrateRangeMenu.confirmFunction = setCalibrateRange;
    calibrateRangeMenu.menuID = CALIBRATE_RANGE;
    calibrateRangeMenu.serialMessage = calRangeStr;
    calibrateRangeMenu.lcdTitleMessage = calRangeTitle;
    calibrateRangeMenu.minVal = 0;
    calibrateRangeMenu.maxVal = 0;
    calibrateRangeMenu.increment = 0;
    calibrateRangeMenu.serialDisplayFunction = dispSerialMessage;
    calibrateRangeMenu.returnToPrevious = returnToRngMenu;
    calibrateRangeMenu.lcdDisplayFunction = noFunctionNumeric;

    NumSamples.confirmFunction = setValue;
    NumSamples.menuID = US_SAMPLE_AVG;
    NumSamples.serialMessage = numSamplesStr;
    NumSamples.lcdTitleMessage = numSampleTitle;
    NumSamples.minVal = 1;
    NumSamples.maxVal = 3;
    NumSamples.increment = 1;
    NumSamples.serialDisplayFunction = dispSetValueMessage;
    NumSamples.returnToPrevious = returnToRngMenu;
    NumSamples.lcdDisplayFunction = noFunctionNumeric;

    UsSampleRate.confirmFunction = setValue;
    UsSampleRate.menuID = US_SAMPLE_RATE;
    UsSampleRate.serialMessage = usSampleRateStr;
    UsSampleRate.lcdTitleMessage = usSampleRateTitle;
    UsSampleRate.minVal = 1;
    UsSampleRate.maxVal = 40;
    UsSampleRate.increment = 1;
    UsSampleRate.serialDisplayFunction = dispSetValueMessage;
    UsSampleRate.returnToPrevious = returnToRngMenu;
    UsSampleRate.lcdDisplayFunction = noFunctionNumeric;

}
/*! **********************************************************************
 * Function: initialization(systemState *state)
 *
 * Include: Local to newmain.c
 *
 * Description: Initializes the system, turns on the sensors and checks if
 * they are ready to begin working
 *
 * Arguments: state - The current state of the system
 *
 * Returns: The next system state - At the moment always just transitions to CHECK
 *************************************************************************/
static void initialization(systemState *state)
{
    Direction dir = {0,-45};
    unsigned int i = 0;
    
    configureSerial();
    configureTracking();
    configUSER();

    move(dir);

    for (i = 0; i < 10000; i++);

    NEXT_STATE_PTR(MENU, state);   //Go to the searching state
}
Beispiel #3
0
	void Serial::SerialBegin()
	{
		configureSerial();
		startSerial();
		
	}