From e93543c1a14e5c5bd00f670aca86628b51e51e5b Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Tue, 26 Nov 2013 22:54:08 -0500 Subject: [PATCH] Fix error with timer1 being written to timer0 --- src/cpu8051.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu8051.c b/src/cpu8051.c index f9dd936..d2ceca3 100644 --- a/src/cpu8051.c +++ b/src/cpu8051.c @@ -293,8 +293,8 @@ process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode, if (tmp == 0) /* If overflow set TF0 */ cpu8051_WriteD(_TCON_, cpu8051_ReadD(_TCON_) | tf_mask); - cpu8051_WriteD(_TH0_, tmp / 0x100); - cpu8051_WriteD(_TL0_, tmp & 0xFF); + cpu8051_WriteD(th, tmp / 0x100); + cpu8051_WriteD(tl, tmp & 0xFF); break; case 1: /* Mode 1, 16-bits counter */ @@ -303,8 +303,8 @@ process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode, tmp &= 0xFFFF; /* We keep only 16 bits */ if (tmp == 0) /* If overflow set TF0 */ cpu8051_WriteD(_TCON_, cpu8051_ReadD(_TCON_) | tf_mask); - cpu8051_WriteD(_TH0_, (tmp / 0x100)); - cpu8051_WriteD(_TL0_, (tmp & 0xFF)); + cpu8051_WriteD(th, (tmp / 0x100)); + cpu8051_WriteD(tl, (tmp & 0xFF)); break; case 2: /* Mode 2, 8-bits counter with Auto-Reload */ -- 2.20.1