Compare commits

..

2 commits

Author SHA1 Message Date
Stephan I. Böttcher
8c6784387e rtc: fixes clockh increment, two bugs 2026-04-14 11:56:31 +02:00
Stephan I. Böttcher
d4e57f5da3 fix flash.c (did not compile) 2026-04-14 11:55:26 +02:00
2 changed files with 3 additions and 3 deletions

View file

@ -220,7 +220,7 @@ static inline
uint8_t flash_erase_next_page() uint8_t flash_erase_next_page()
{ {
uint16_t mode = 0x81; // Page Erase uint16_t mode = 0x81; // Page Erase
if (~b & 8) if (~fs.block & 8)
fs.npages++; fs.npages++;
uint8_t n = 0; uint8_t n = 0;
if (fs.page && !(fs.page & 0xff) && fs.npages & 0xff00) { if (fs.page && !(fs.page & 0xff) && fs.npages & 0xff00) {

View file

@ -81,7 +81,7 @@ ISR(RTC_CNT_vect, ISR_NAKED)
"subi r24, -1" "\n\t" "subi r24, -1" "\n\t"
"sts clockh, r24" "\n\t" "sts clockh, r24" "\n\t"
"lds r24, clockh+1" "\n\t" "lds r24, clockh+1" "\n\t"
"sbci r24, -1" "\n\t" "sbci r24, 0" "\n\t"
"sts clockh+1, r24" "\n\t" "sts clockh+1, r24" "\n\t"
"2:" "\n\t" "2:" "\n\t"
"pop r24" "\n\t" "pop r24" "\n\t"
@ -109,7 +109,7 @@ ISR(RTC_CNT_vect)
if (flag & RTC_CNT_bm) if (flag & RTC_CNT_bm)
RTC.CMP += rtc_config[1].val | rtc_config[2].val << 8; RTC.CMP += rtc_config[1].val | rtc_config[2].val << 8;
if (flag & RTC_OVF_bm) if (flag & RTC_OVF_bm)
clock += 1; clockh += 1;
return; return;
} }
#endif #endif