; *************************************************************************** ; copyright : (C) 2026 by Martin Preuss ; email : martin@libchipcard.de ; ; *************************************************************************** ; * This file is part of the project "AqHome". * ; * Please see toplevel file COPYING of that project for license details. * ; *************************************************************************** ; *************************************************************************** ; defs .equ DS1307_FLAGS_PRESENT_BIT = 7 .equ DS1307_FLAGS_VALID_BIT = 6 ; *************************************************************************** ; data .dseg ds1307DataBegin: ds1307Flags: .byte 1 ds1307RecvBuffer: .byte 7 ds1307DataEnd: ; *************************************************************************** ; code .cseg ; --------------------------------------------------------------------------- ; @routine Ds1307_Init @global ; ; @return CFLAG set if okay, cleared on error ; @clobbers Ds1307_Init: ldi xh, HIGH(ds1307DataBegin) ldi xl, LOW(ds1307DataBegin) clr r16 ldi r17, (ds1307DataEnd-ds1307DataBegin) rcall Utils_FillSram rcall ds1307CheckPresence brcc Ds1307_Init_ret ldi r16, (1<