Commit 1d227277b3d0039f9faef9ea62880ca3051b14f8 v1.7
authorMichel Pollet <buserror@gmail.com>
Thu, 1 Apr 2021 20:36:05 +0000 (21:36 +0100)
committerMichel Pollet <buserror@gmail.com>
Thu, 1 Apr 2021 20:36:05 +0000 (21:36 +0100)
Used a boolean not instead of a binary one.

Signed-off-by: Michel Pollet <buserror@gmail.com>
examples/parts/ds1338_virt.c

index 5381a16ca4ab245e8a1e9176138a3ed31680ea3f..65817332e819c4d25a43cc99d0c879242464338c 100644 (file)
@@ -159,7 +159,7 @@ ds1338_virt_tick_time(ds1338_virt_t *p) {
                if (cascade) {
                        if (pm) {
                                // Switch to AM
-                               p->nvram[DS1338_VIRT_HOURS] &= !(1 << DS1338_VIRT_AM_PM);
+                               p->nvram[DS1338_VIRT_HOURS] &= ~(1 << DS1338_VIRT_AM_PM);
                        } else {
                                // Switch to PM and catch the cascade
                                p->nvram[DS1338_VIRT_HOURS] |= (1 << DS1338_VIRT_AM_PM);
@@ -417,7 +417,7 @@ ds1338_virt_in_hook(struct avr_irq_t * irq,
                        // Write to the selected register (see p13. DS1388 datasheet for details)
                        if (p->reg_selected) {
                                if (p->verbose)
-                                       printf("DS1338 set register 0x%02x to 0x%02x\n", 
+                                       printf("DS1338 set register 0x%02x to 0x%02x\n",
                                                p->reg_addr, v.u.twi.data);
                                p->nvram[p->reg_addr] = v.u.twi.data;
                                ds1338_virt_update(p);