From: Michel Pollet Date: Thu, 1 Apr 2021 20:36:05 +0000 (+0100) Subject: ds1338L: Fix a logic bug X-Git-Tag: v1.7 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=1d227277b3d0039f9faef9ea62880ca3051b14f8;p=sx%2Fsimavr.git ds1338L: Fix a logic bug Used a boolean not instead of a binary one. Signed-off-by: Michel Pollet --- diff --git a/examples/parts/ds1338_virt.c b/examples/parts/ds1338_virt.c index 5381a16..6581733 100644 --- a/examples/parts/ds1338_virt.c +++ b/examples/parts/ds1338_virt.c @@ -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);