main: init bmp280. cleanup.

This commit is contained in:
Martin Preuss
2023-01-30 01:03:02 +01:00
parent 4864d16482
commit b34f3ce2cb

View File

@@ -39,6 +39,8 @@
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; TWI master module ; TWI master module
.equ LCD_TWI_ADDRESS = 0x3c
.equ TWI_DDR_SCL = DDRA .equ TWI_DDR_SCL = DDRA
.equ TWI_PORT_SCL = PORTA .equ TWI_PORT_SCL = PORTA
.equ TWI_PIN_SCL = PINA .equ TWI_PIN_SCL = PINA
@@ -52,6 +54,12 @@
; ---------------------------------------------------------------------------
; BMP 280
.equ BMP280_ADDR = 0x76
; *************************************************************************** ; ***************************************************************************
; code segment ; code segment
@@ -92,6 +100,7 @@
.include "com.asm" .include "com.asm"
.include "twimaster.asm" .include "twimaster.asm"
.include "lcd.asm" .include "lcd.asm"
.include "bmp280.asm"
@@ -192,6 +201,7 @@ initModules:
rcall Com_Init rcall Com_Init
rcall TWI_Master_Init rcall TWI_Master_Init
rcall LCD_Init rcall LCD_Init
rcall BMP280_Init
ret ret
@@ -282,16 +292,6 @@ onEverySecond:
; USED: depending on called routines ; USED: depending on called routines
onEvery10s: onEvery10s:
in r15, SREG ; debug
cli
push r15
ldi r16, 219
rcall COM_EnqueuePing
pop r15
out SREG, r15
rcall printSendStats
ret ret
@@ -308,8 +308,17 @@ onEvery10s:
; USED: depending on called routines ; USED: depending on called routines
onEveryMinute: onEveryMinute:
in r15, SREG ; debug
cli
push r15
ldi r16, 219 ldi r16, 219
rcall COM_EnqueueComSendStats rcall COM_EnqueueComSendStats
rcall printSendStats
;ldi r16, 219
;rcall COM_EnqueuePing
pop r15
out SREG, r15
ret ret
@@ -327,8 +336,6 @@ onEveryMinute:
; USED: depending on called routines ; USED: depending on called routines
onPacketReceived: onPacketReceived:
sbi DDRA, PORTA2 ; debug
sbi PINA, PORTA2 ; debug (toggle)
clc ; not handled clc ; not handled
ret ret
@@ -382,6 +389,9 @@ debugSendByte:
printSendStats: printSendStats:
push r15
in r15, SREG ; debug
cli
ldi r18, 0 ldi r18, 0
ldi r19, 2 ldi r19, 2
rcall LCD_SetCursor rcall LCD_SetCursor
@@ -432,7 +442,8 @@ printSendStats:
lds r18, comStatsAborted lds r18, comStatsAborted
lds r19, comStatsAborted+1 lds r19, comStatsAborted+1
rcall LCD_PrintHexWord rcall LCD_PrintHexWord
pop r15
out SREG, r15
ret ret