Пн мар 04, 2024 14:27:00
Вт мар 05, 2024 21:01:21
Чт мар 07, 2024 14:11:21
Чт мар 14, 2024 23:57:59
Пт мар 15, 2024 09:17:09
Пт мар 15, 2024 09:26:20
.equ enRS485_D, 15
bset LATD, enRS485_D
Пт мар 15, 2024 10:37:39
Пт мар 15, 2024 13:27:17
Пт мар 15, 2024 15:03:31
Пт мар 15, 2024 16:46:33
Пт мар 15, 2024 17:39:51
Пт мар 15, 2024 17:49:29
Пт мар 15, 2024 18:06:56
Пт мар 15, 2024 18:48:30
Пт мар 15, 2024 18:58:17
#define UART_RX_PIN_NUMB 3
#define UART_RX_PIN GPIO,UART_RX_PIN_NUMB
_waitLevel macro gpio,level
movfw GPIO ; read GPIO state before sleep
sleep
nop ; 1 nop after WakeUp
#if level == 0
btfsc GPIO,gpio
#else
#if level == 1
btfss GPIO,gpio
#else
ERROR "Waiting level is not valid"
#endif
#endif
goto $-4
endm
_waitLevel UART_RX_PIN_NUMB,0 ; waiting \_ on UART_RX_PIN
#define UART_RX_PIN GPIO,3
_waitLevel macro gpio,level
movfw GPIO ; read GPIO state before sleep
sleep
nop ; 1 nop after WakeUp
#if level == 0
btfsc gpio
#else
#if level == 1
btfss gpio
#else
ERROR "Waiting level is not valid"
#endif
#endif
goto $-4
endm
_waitLevel UART_RX_PIN,0 ; waiting \_ on UART_RX_PIN
Пт мар 15, 2024 22:11:10
#define LED1 PORTC,2,1
#define LED2 PORTC,3,0
on macro port,pin,level
if level
bsf port,pin
else
bcf port,pin
endif
endm
off macro port,pin,level
if !level
bsf port,pin
else
bcf port,pin
endif
endm
org 0
on LED1
on LED2
off LED1
off LED2
end
Сб мар 16, 2024 02:09:02
#define LED1 PORTC,2,1
Сб мар 16, 2024 03:28:48
Сб мар 16, 2024 08:42:58
// в хедере - правим только здесь:
#define LED B,5,L
#define KEY B,0,L
#define BUZ C,1,H
#define con_init() (...)
#define UART_DATA UDR
// в С - без изменений:
int main() {
out(LED);
off(LED);
off(BUZ);
out(BUZ);
pullup(KEY);
con_init();
con_printP("Hello " __DATE__ " " __TIME__);
while (true) {
if (pin(KEY)) {
toggle(LED);
on(BUZ);
delay(SHORT_BEEP);
off(BUZ);
}
}
}
Сб мар 16, 2024 15:32:11