; ***************************************************************************
; copyright   : (C) 2025 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.   *
; ***************************************************************************



.cseg



ScreenPrintErrors:
  ldi yl, LOW(netInterfaceData)
  ldi yh, HIGH(netInterfaceData)
  
  ldi r16, 0
  rcall LCD_Fill

  ldi r18, 0
  ldi r19, 0
  rcall LCD_SetCursor
  ldi zl, LOW(screenTxtSystem)
  ldi zh, HIGH(screenTxtSystem)
  rcall LCD_PrintFromFlash

  ldi r18, 0
  ldi r19, 2
  rcall LCD_SetCursor
  ldi zl, LOW(screenTxtPacketsIn)
  ldi zh, HIGH(screenTxtPacketsIn)
  rcall LCD_PrintFromFlash
  ldi r18, 64
  ldi r19, 2
  rcall LCD_SetCursor
  ldd r18, Y+NET_IFACE_OFFS_PACKETSIN_LOW
  ldd r19, Y+NET_IFACE_OFFS_PACKETSIN_HIGH
  rcall LCD_PrintHexWord

  ldi r18, 0
  ldi r19, 3
  rcall LCD_SetCursor
  ldi zl, LOW(screenTxtPacketsOut)
  ldi zh, HIGH(screenTxtPacketsOut)
  rcall LCD_PrintFromFlash
  ldi r18, 64
  ldi r19, 3
  rcall LCD_SetCursor
  ldd r18, Y+NET_IFACE_OFFS_PACKETSOUT_LOW
  ldd r19, Y+NET_IFACE_OFFS_PACKETSOUT_HIGH
  rcall LCD_PrintHexWord

  ldi r18, 0
  ldi r19, 4
  rcall LCD_SetCursor
  ldi zl, LOW(screenTxtEContent)
  ldi zh, HIGH(screenTxtEContent)
  rcall LCD_PrintFromFlash
  ldi r18, 64
  ldi r19, 4
  rcall LCD_SetCursor
  ldd r18, Y+NET_IFACE_OFFS_ERR_CONTENT_LOW
  ldd r19, Y+NET_IFACE_OFFS_ERR_CONTENT_HIGH
  rcall LCD_PrintHexWord

  ldi r18, 0
  ldi r19, 5
  rcall LCD_SetCursor
  ldi zl, LOW(screenTxtEMsgSize)
  ldi zh, HIGH(screenTxtEMsgSize)
  rcall LCD_PrintFromFlash
  ldi r18, 64
  ldi r19, 5
  rcall LCD_SetCursor
  ldd r18, Y+NET_IFACE_OFFS_ERR_MSGSIZE_LOW
  ldd r19, Y+NET_IFACE_OFFS_ERR_MSGSIZE_HIGH
  rcall LCD_PrintHexWord

  ret
; @end


screenTxtSystem: .db "AqHOME %YEAR%/%MONTH%/%DAY%-%HOUR%:%MINUTE%", 0

screenTxtPacketsIn:
  .db "In:", 0

screenTxtPacketsOut:
  .db "Out:", 0, 0

screenTxtEContent:
  .db "eCRC:", 0

screenTxtEMsgSize:
  .db "eSize:", 0, 0

