finished basic new structure.
This commit is contained in:
50
avr/modules/comproto/msg_sysstats.asm
Normal file
50
avr/modules/comproto/msg_sysstats.asm
Normal file
@@ -0,0 +1,50 @@
|
||||
; ***************************************************************************
|
||||
; copyright : (C) 2023 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. *
|
||||
; ***************************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
; code
|
||||
|
||||
.cseg
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Write a SYSSTATS packet.
|
||||
;
|
||||
; IN:
|
||||
; - R16: destination address
|
||||
; - X : buffer to write to
|
||||
; OUT:
|
||||
; - nothing
|
||||
; REGS: R3, R4, R16, R17, R18, X (R19, R20, R21)
|
||||
|
||||
CPRO_WriteSysStats:
|
||||
ldi r17, COM2_PAYLOAD_FLAGS_UID | COM2_PAYLOAD_FLAGS_SECONDS | (4<<COM2_PAYLOAD_FLAGS_SHIFT_NUM)
|
||||
ldi r18, CPRO_CMD_SYSSTATS
|
||||
push xh
|
||||
push xl
|
||||
rcall COM2_BeginMsgWithVariablePayload ; (R3, R4, R16, R17, R18, R19, R20, R21, X)
|
||||
; payload
|
||||
lds r17, com2Interrupts
|
||||
st X+, r17 ; com interrupts
|
||||
lds r17, com2Interrupts+1
|
||||
st X+, r17
|
||||
|
||||
lds r17, timerInterrupts
|
||||
st X+, r17 ; timer interrupts
|
||||
lds r17, timerInterrupts+1
|
||||
st X+, r17
|
||||
pop xl
|
||||
pop xh
|
||||
rcall com2CalcAndAddChecksumByte ; (R16, R17, R18, R19, X)
|
||||
ret
|
||||
|
||||
|
||||
Reference in New Issue
Block a user