Commit 01f15886 authored by Ivan Tyagov's avatar Ivan Tyagov

Typos and cosmetics.

parent 08ad914a
......@@ -36,7 +36,7 @@
unsigned long int getMilliSecondsSinceEpoch() {
/*
* Return milli seconds since epoch.
* Return milliseconds since epoch.
*/
struct timeval current_time;
gettimeofday(&current_time, NULL);
......
......@@ -102,5 +102,4 @@ void gotoNormalMode() {
UA_LOGCATEGORY_USERLAND, \
"Go to NORMAL MODE");
I2C_VIRTUAL_MODE = 0;
}
......@@ -68,7 +68,7 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
// UA_LOGCATEGORY_USERLAND, \
// "HEART BEAT: %d (%ld)", coupler_id, milli_seconds_now);
// convert coupler_id to str
// convert coupler_id to str
char* coupler_id_str = convertInt2Str(coupler_id);
// convert micro seconds to str
......@@ -77,11 +77,10 @@ static void dataChangeNotificationCallback(UA_Server *server, UA_UInt32 monitore
// Add to our local linked list
addItem(&SUBSCRIBER_DICT, coupler_id_str, milli_seconds_now_str);
// set GPIO so we can monitor using logical analyzer the work of
// keep-alive network system
if (CURRENT_GPIO_MODE == 1) setGPIO();
}
// set GPIO so we can monitor using logical analyzer the work of
// keep-alive network system
if (CURRENT_GPIO_MODE == 1) setGPIO();
}
}
}
......@@ -285,8 +284,8 @@ void callbackCheckHeartBeat() {
// initial keep alive received, printout
UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND,
"UP (recovered %d times): %s", SAFE_MODE_STATE_COUNTER, coupler_id_str);
// go to normal operational mode
gotoNormalMode();
// go to normal operational mode
gotoNormalMode();
}
CURRENT_STATE = STATE_UP;
}
......
......@@ -223,12 +223,12 @@ static int getAnalogInputStateAIN(int i2c_addr, int **analog_input, uint8_t read
else
{
int analog_data = 0;
// based on https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/MOD-IO/main.c
// since ADC is 10 bit we need to read and convert accordingly 2 bytes
analog_data = read_buf[1];
analog_data <<= 8;
analog_data |= read_buf[0];
*analog_input = &analog_data;
// based on https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/MOD-IO/main.c
// since ADC is 10 bit we need to read and convert accordingly 2 bytes
analog_data = read_buf[1];
analog_data <<= 8;
analog_data |= read_buf[0];
*analog_input = &analog_data;
}
close(file);
}
......
......@@ -96,7 +96,7 @@ static void addVariable(UA_Server *server)
/*
* Create all variables representing MOD-IO's relays
*/
int i,n;;
int i,n;
int length = getI2CSlaveListLength();
char *node_id = malloc(sizeof(char) * 10);
char *node_title = malloc(sizeof(char) * 30);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment