mirror of
https://codeberg.org/SiB64/turbo_weather.git
synced 2026-06-28 23:49:51 +02:00
Compare commits
2 commits
b50205b62b
...
c2823eded9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2823eded9 | ||
|
|
71f57d2f06 |
4 changed files with 25 additions and 0 deletions
10
src/bate.c
10
src/bate.c
|
|
@ -496,6 +496,9 @@ int main()
|
||||||
send_calib_adc(i);
|
send_calib_adc(i);
|
||||||
send_eol();
|
send_eol();
|
||||||
}
|
}
|
||||||
|
if (config.send & (SEND_ADC_VOLT|SEND_ADC_HEX))
|
||||||
|
if (config.power & POWER_LINE)
|
||||||
|
send_cks();
|
||||||
}
|
}
|
||||||
|
|
||||||
command();
|
command();
|
||||||
|
|
@ -560,6 +563,8 @@ int main()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uart_cks = 0;
|
||||||
|
|
||||||
if (config.send & SEND_CONFIG && !config_clock--) {
|
if (config.send & SEND_CONFIG && !config_clock--) {
|
||||||
send_config = 1;
|
send_config = 1;
|
||||||
config_clock = config.confp;
|
config_clock = config.confp;
|
||||||
|
|
@ -618,6 +623,11 @@ int main()
|
||||||
DEBUG_PRINT(0x77, trigger);
|
DEBUG_PRINT(0x77, trigger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.power & POWER_LINE) {
|
||||||
|
send_cks();
|
||||||
|
uart_cks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
uart_tick();
|
uart_tick();
|
||||||
trigger = TRIGGER_CONT;
|
trigger = TRIGGER_CONT;
|
||||||
send_config = 0;
|
send_config = 0;
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ uint8_t uart_tx[256];
|
||||||
volatile uint8_t uart_tx_w;
|
volatile uint8_t uart_tx_w;
|
||||||
volatile uint8_t uart_tx_r;
|
volatile uint8_t uart_tx_r;
|
||||||
volatile uint8_t uart_tx_busy;
|
volatile uint8_t uart_tx_busy;
|
||||||
|
uint8_t uart_cks;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,3 +35,6 @@ void send_hex_long(uint32_t b)
|
||||||
send_hex_word(b >> 16);
|
send_hex_word(b >> 16);
|
||||||
send_hex_word(b);
|
send_hex_word(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern uint8_t uart_cks;
|
||||||
|
void send_cks();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
.global send_str
|
.global send_str
|
||||||
.global uart_busy
|
.global uart_busy
|
||||||
.global send_hex
|
.global send_hex
|
||||||
|
.global send_cks
|
||||||
.global send_eol
|
.global send_eol
|
||||||
.global command
|
.global command
|
||||||
|
|
||||||
|
|
@ -34,6 +35,9 @@ put_char:
|
||||||
sbci r31, hi8(-(uart_tx))
|
sbci r31, hi8(-(uart_tx))
|
||||||
st Z, r22
|
st Z, r22
|
||||||
sts uart_tx_w, r19
|
sts uart_tx_w, r19
|
||||||
|
lds r19, uart_cks
|
||||||
|
add r19, r22
|
||||||
|
sts uart_cks, r19
|
||||||
1:
|
1:
|
||||||
// r22 preserved
|
// r22 preserved
|
||||||
// r23 full when zero
|
// r23 full when zero
|
||||||
|
|
@ -89,6 +93,13 @@ uart_busy:
|
||||||
9:
|
9:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
; send_hex('Q', &uart_cks, 1, 0);
|
||||||
|
send_cks:
|
||||||
|
ldi r24, 'Q'
|
||||||
|
ldi r18, 0
|
||||||
|
ldi r20, 1
|
||||||
|
ldi r22, lo8(uart_cks)
|
||||||
|
ldi r23, hi8(uart_cks)
|
||||||
send_hex:
|
send_hex:
|
||||||
movw r26, r22
|
movw r26, r22
|
||||||
rcall send_char
|
rcall send_char
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue