mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-07 04:16:26 +02:00
Minor changes
This commit is contained in:
parent
a3bb6ee6d7
commit
641888e41b
3 changed files with 7 additions and 7 deletions
2
Makefile
2
Makefile
|
@ -6,7 +6,7 @@ CFLAGS=
|
||||||
MACROS=\
|
MACROS=\
|
||||||
-DZMQ_TOKEN=\"$(ZMQ_TOKEN)\" \
|
-DZMQ_TOKEN=\"$(ZMQ_TOKEN)\" \
|
||||||
-DZMQ_MSG_SIZE=$(ZMQ_MSG_SIZE) \
|
-DZMQ_MSG_SIZE=$(ZMQ_MSG_SIZE) \
|
||||||
-DLOGGER_DELAY=$(LOGGER_DELAY)
|
-DLOGGERS_DELAY=$(LOGGERS_DELAY)
|
||||||
|
|
||||||
all: publisher subscriber logger
|
all: publisher subscriber logger
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ ZMQ_MSG_SIZE=5242880
|
||||||
# LOGGERS_DIR will contains all the data generated by the loggers
|
# LOGGERS_DIR will contains all the data generated by the loggers
|
||||||
# a.k.a the ina260 power measurements
|
# a.k.a the ina260 power measurements
|
||||||
LOGGERS_DIR=./logs
|
LOGGERS_DIR=./logs
|
||||||
# LOGGER_DELAY defines the delay between 2 consecutive
|
# LOGGERS_DELAY defines the delay between 2 consecutive
|
||||||
# ina260 power read performed by the logger
|
# ina260 power read performed by the logger
|
||||||
# Unit is milliseconds
|
# Unit is milliseconds
|
||||||
LOGGER_DELAY=1000
|
LOGGERS_DELAY=1000
|
||||||
# SUBSCRIBER_DIR will contain all the measurments
|
# SUBSCRIBER_DIR will contain all the measurments
|
||||||
# received from the publishers
|
# received from the publishers
|
||||||
SUBSCRIBER_DIR=./data
|
SUBSCRIBER_DIR=./data
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#ifndef LOGGER_DELAY
|
#ifndef LOGGERS_DELAY
|
||||||
#define LOGGER_DELAY 0
|
#define LOGGERS_DELAY 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Global:
|
// Global:
|
||||||
|
@ -86,8 +86,8 @@ int main (int argc, char *argv [])
|
||||||
fprintf(logptr,"%d,%ld,%d\n",power_ts.tv_sec,power_ts.tv_nsec,power);
|
fprintf(logptr,"%d,%ld,%d\n",power_ts.tv_sec,power_ts.tv_nsec,power);
|
||||||
// Reset power register file:
|
// Reset power register file:
|
||||||
fseek(regptr,0,SEEK_SET);
|
fseek(regptr,0,SEEK_SET);
|
||||||
#if LOGGER_DELAY > 0
|
#if LOGGERS_DELAY > 0
|
||||||
usleep(LOGGER_DELAY*1000);
|
usleep(LOGGERS_DELAY*1000);
|
||||||
#endif
|
#endif
|
||||||
printf("Tick\n"); fflush(stdout);
|
printf("Tick\n"); fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue