[hamradio-commits] [dump1090] 14/389: Show 16 bit magnitude value with --debug.
Matthew Ernisse
mernisse-guest at moszumanska.debian.org
Wed Nov 5 00:19:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
mernisse-guest pushed a commit to branch master
in repository dump1090.
commit fed415b6996dc4bcd076f103f57d38474f413505
Author: antirez <antirez at gmail.com>
Date: Mon Jan 7 00:29:35 2013 +0100
Show 16 bit magnitude value with --debug.
---
dump1090.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dump1090.c b/dump1090.c
index c33156c..b9a7879 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -387,19 +387,19 @@ void *readerThreadEntryPoint(void *arg) {
* "." is 1
*/
void dumpMagnitudeBar(int index, int magnitude) {
- char *set = ".-o";
+ char *set = " .-o";
char buf[256];
- int div = magnitude / 4;
- int rem = magnitude % 4;
+ int div = magnitude / 256 / 4;
+ int rem = magnitude / 256 % 4;
memset(buf,'O',div);
buf[div] = set[rem];
buf[div+1] = '\0';
if (index >= 0)
- printf("[%.3d] |%-69s %d\n", index, buf, magnitude);
+ printf("[%.3d] |%-66s %d\n", index, buf, magnitude);
else
- printf("[%.2d] |%-69s %d\n", index, buf, magnitude);
+ printf("[%.2d] |%-66s %d\n", index, buf, magnitude);
}
/* Display an ASCII-art alike graphical representation of the undecoded
@@ -418,8 +418,7 @@ void dumpMagnitudeVector(uint16_t *m, uint32_t offset) {
uint32_t j;
for (j = start; j <= end; j++) {
- /* Scale magnitude to 0-255 from 0-65535 before printing. */
- dumpMagnitudeBar(j-offset, m[j]/256);
+ dumpMagnitudeBar(j-offset, m[j]);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git
More information about the pkg-hamradio-commits
mailing list