37 #include <sys/types.h>
49 #define RS (sizeof(gpioReport_t))
58 gettimeofday(&now, NULL);
60 localtime_r(&now.tv_sec, &tmp);
61 strftime(buf,
sizeof(buf),
"%F %T", &tmp);
68 if (bit < 26)
return (
'A' + bit);
69 else return (
'a' + bit - 26);
72 int main(
int argc,
char * argv[])
76 uint32_t lastLevel, changed;
82 if (
r !=
RS) exit(-1);
85 printf(
"$version pig2vcd V1 $end\n");
86 printf(
"$timescale 1 us $end\n");
87 printf(
"$scope module top $end\n");
90 printf(
"$var wire 1 %c %d $end\n",
symbol(b), b);
92 printf(
"$upscope $end\n");
93 printf(
"$enddefinitions $end\n");
100 if (
report.level != lastLevel)
104 changed =
report.level ^ lastLevel;
110 if (changed & (1<<b))
112 if (
report.level & (1<<b))
v=
'1';
else v=
'0';
114 printf(
"%c%c\n",
v,
symbol(b));