System configuration data – Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 127

Advertising
background image

126

CHAPTER 11 • CLICK SUPERVISOR SUPPORT

// Function declarations
void ClickSupervisorOemResetToFactoryDefaults(int resetCode)
{
memset(&ClickSupervisorOemConfig0,0x00,
sizeof(ClickSupervisorOemConfig0));
// Example - text string int edit box
ClickUtilSetDefaultString(
ClickSupervisorOemConfig0.AlertMessage,
DefaultAlertMessage, 32);
// Example - char - numeric up/down
// Max speed threshold
ClickSupervisorOemConfig0.overSpeedMPH = 45;
// Min speed threshold
ClickSupervisorOemConfig0.underSpeedMPH = 65;
// Example - int - numeric up/down
// Duration = 500 dec
// Duration = 0x01F4
ClickSupervisorOemConfig0.outputDurationMSB = 0x01;
ClickSupervisorOemConfig0.outputDurationLSB = 0xF4;
// Example - check box
ClickSupervisorOemConfig0.enableAlerts = SET1;
// Example - dropdown box
ClickSupervisorOemConfig0.hourOffsetLSB = 0x0C;
ClickSupervisorOemConfig0.hourOffsetMSB = 0x00;
ClickflashWriteSupervisor(OEM_CONFIG_0,
&ClickSupervisorOemConfig0,
sizeof(ClickSupervisorOemConfig0));
}

ryDefaults will need to be created for each application you write that uses Click Supervisor,

even if you do not plan on setting any values to factory defaults. Otherwise, you will get the

following compiler error message “Undefined (but used) global label reference to ‘ClickSu-

pervisorOemResetToFactoryDefaults’ has no corresponding prototype.”

To overcome this compiler error, you can simply create a function instance with a blank

code block. However, you will often want to set OEM variables to default values, and in that

case, the code block will not be blank.

System Configuration Data

Click Supervisor system configuration variables hold data common to all Click devices in a

standard format. These variables include:

Advertising