Compare commits
4 Commits
add_vif_vo
...
master
Author | SHA1 | Date | |
---|---|---|---|
4ceabca1b4 | |||
a33dbe2387 | |||
78509ff2cb | |||
13c8344276 |
@ -218,7 +218,7 @@ static void parseAndPrintFrame() {
|
|||||||
// mbusCommHandle.requestId,
|
// mbusCommHandle.requestId,
|
||||||
// parsedVIB.name, parsedVIB.unit, parsedVIB.exponent);
|
// parsedVIB.name, parsedVIB.unit, parsedVIB.exponent);
|
||||||
if (parsedVIB.found) {
|
if (parsedVIB.found) {
|
||||||
uint32_t value = strtol(mbus_data_record_value(record), NULL, 10);
|
int32_t value = strtol(mbus_data_record_value(record), NULL, 10);
|
||||||
float weightedValue = ((float) value) * powf(10.0, ((float) parsedVIB.exponent));
|
float weightedValue = ((float) value) * powf(10.0, ((float) parsedVIB.exponent));
|
||||||
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] %s is %.1f %s (%d * 10^%d)",
|
coloredMsg(LOG_YELLOW, false, "mbc papf [%d] %s is %.1f %s (%d * 10^%d)",
|
||||||
mbusCommHandle.requestId, parsedVIB.name, weightedValue, parsedVIB.unit,
|
mbusCommHandle.requestId, parsedVIB.name, weightedValue, parsedVIB.unit,
|
||||||
|
BIN
docs/IMG_2915.jpg
Normal file
BIN
docs/IMG_2915.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 MiB |
@ -1,3 +1,6 @@
|
|||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Build environment
|
## Build environment
|
||||||
|
|
||||||
On Ubuntu/Debian install
|
On Ubuntu/Debian install
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
CFLAGS=-I../cube/User/Inc -DTEST
|
CFLAGS=-I../../cube/User/Inc -DTEST
|
||||||
|
|
||||||
test: ringbuffer.o test.o
|
test: ringbuffer.o test.o
|
||||||
gcc -o $@ -lcunit $^
|
gcc -o $@ -lcunit $^
|
||||||
|
|
||||||
ringbuffer.o: ../cube/User/Src/ringbuffer.c
|
ringbuffer.o: ../../cube/User/Src/ringbuffer.c
|
||||||
gcc -c -o $@ $(CFLAGS) $^
|
gcc -c -o $@ $(CFLAGS) $^
|
||||||
|
|
||||||
logger.o: ../cube/User/Src/logger.c
|
logger.o: ../../cube/User/Src/logger.c
|
||||||
gcc -c -o $@ $(CFLAGS) $^
|
gcc -c -o $@ $(CFLAGS) $^
|
||||||
|
|
||||||
test.o: test.c
|
test.o: test.c
|
15
tests/test2/Makefile
Normal file
15
tests/test2/Makefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
test: test.o
|
||||||
|
gcc -o $@ $^
|
||||||
|
|
||||||
|
test.o: test.c
|
||||||
|
gcc -c -o $@ $(CFLAGS) $^
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run: test
|
||||||
|
./test
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm -f *.o test
|
||||||
|
|
10
tests/test2/test.c
Normal file
10
tests/test2/test.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
uint32_t i = -10;
|
||||||
|
int32_t j = i;
|
||||||
|
|
||||||
|
printf("%lu %d\n", i, j);
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user