- dt: formatting code using astyle

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-07-05 22:39:39 +02:00
committed by Thilo Graf
parent d82fc76413
commit 7dcd1d92fc

View File

@@ -71,13 +71,16 @@ int main(int argc, char **argv)
t = time(NULL);
tmp = localtime(&t);
if (tmp == NULL) {
if (tmp == NULL)
{
perror("localtime");
}
if (strftime(h, sizeof(h), "%_H", tmp) == 0) {
if (strftime(h, sizeof(h), "%_H", tmp) == 0)
{
fprintf(stderr, "strftime returned 0\n");
}
if (strftime(m, sizeof(m), "%_M", tmp) == 0) {
if (strftime(m, sizeof(m), "%_M", tmp) == 0)
{
fprintf(stderr, "strftime returned 0\n");
}
@@ -129,14 +132,16 @@ int main(int argc, char **argv)
}
else if (sscanf(argv[x], "-ls%X", &b) == 1)
{
if ((b > 0) && (b <= 8)) {
if ((b > 0) && (b <= 8))
{
if (ioctl(fd, IOC_FP_LED_CTRL, b | 0x80))
perror("IOC_FP_LED_CTRL");
}
}
else if (sscanf(argv[x], "-lc%X", &b) == 1)
{
if ((b > 0) && (b <= 8)) {
if ((b > 0) && (b <= 8))
{
if (ioctl(fd, IOC_FP_LED_CTRL, b))
perror("IOC_FP_LED_CTRL");
}
@@ -146,7 +151,8 @@ int main(int argc, char **argv)
fp_standby_cmd_data_t pwr;
pwr.addr = 0;
pwr.cmd = b;
printf("standby command: %x\n", pwr.cmd);fflush(stdout);
printf("standby command: %x\n", pwr.cmd);
fflush(stdout);
if (ioctl(fd, IOC_FP_STANDBY_CMD, &pwr))
perror("IOC_FP_STANDBY_CMD");