summaryrefslogtreecommitdiffstats
path: root/r503.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-05-07 14:46:05 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-05-07 14:46:05 +0800
commit737e4e248ce408c43ac02917a5fa9aced89b7af6 (patch)
treed7d1935a2752943120292ed7a75a5f42ec1daef3 /r503.c
parentd3949ef1b98d6ef2a135d9b31b26d86314acce60 (diff)
downloadavr-fpm-drivers-737e4e248ce408c43ac02917a5fa9aced89b7af6.tar.gz
Delete all prints.
Diffstat (limited to 'r503.c')
-rw-r--r--r503.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/r503.c b/r503.c
index cb37f32..e970c59 100644
--- a/r503.c
+++ b/r503.c
@@ -126,9 +126,10 @@ static inline uint8_t check_pwd(void)
return buf[0] == OK;
}
-void fpm_led_on(FPM_LED_COLOR color)
+void fpm_led_on(COLOR color)
{
- uint8_t buf[5];
+ uint16_t n;
+ uint8_t buf[MAXPDLEN];
buf[0] = 0x35;
buf[1] = 0x03;
@@ -137,11 +138,13 @@ void fpm_led_on(FPM_LED_COLOR color)
buf[4] = 0x00;
send(0x01, buf, 5);
+ recv(buf, &n);
}
void fpm_led_off(void)
{
- uint8_t buf[5];
+ uint16_t n;
+ uint8_t buf[MAXPDLEN];
buf[0] = 0x35;
buf[1] = 0x04;
@@ -150,6 +153,7 @@ void fpm_led_off(void)
buf[4] = 0x00;
send(0x01, buf, 5);
+ recv(buf, &n);
}
uint8_t fpm_init(void)
@@ -165,6 +169,16 @@ uint8_t fpm_init(void)
UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);
_delay_ms(RST_DELAY_MS);
- return 1;
+ return check_pwd();
}
+uint8_t fpm_clear_db(void)
+{
+ uint16_t n;
+ uint8_t buf[MAXPDLEN];
+
+ buf[0] = 0x0D;
+ send(0x01, buf, 1);
+ recv(buf, &n);
+ return buf[0] == OK;
+}