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

Typos and cosmetics.

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