Go_unconfigured( ) function, Syntax, Example – Echelon Neuron C User Manual

Page 107: High_byte( ) built-in function, Interrupt_control( ) built-in function

Advertising
background image

Neuron C Reference Guide

87

go_unconfigured( )

Function

The go_unconfigured( ) function puts the device into an unconfigured state. It

also overwrites all the domain information, which clears authentication keys as
well.
The go_unconfigured( ) function can be used after detecting and logging a serious,

unrecoverable error. Some security devices also call this function when they
detect a attempt to tamper with the device, and thus render the device

inoperational and erase the secret authentication keys.

Syntax

#include <control.h>
void go_unconfigured (void);

Example

void f() {
...
if (unrecoverable) {
error_log(MY_UNRECOVERABLE_ERROR);
go_unconfigured();
}
}

high_byte( )

Built-in Function

The high_byte( ) built-in function extracts the upper single-byte value from the

a

double-byte operand. This function operates without regard to signedness. See

also low_byte( ), make_long( ), and swap_bytes( ).

Syntax

unsigned short high_byte (unsigned long

a

);

Example

short b;
long a;

void f(void)
{

a = 258;

// Hex value 0x0102

b = high_byte(a);

// b now contains the value 0x01

}

interrupt_control( )

Built-in Function

The interrupt_control( ) built-in function enables or disables interrupts. You can
call the interrupt_control( ) function at any time to enable or disable one or more

of the three interrupt types: I/O interrupts, timer/counter interrupts, or periodic
system timer interrupts. This function applies only to the hardware interrupts

Advertising