diff options
| author | Sadeep Madurange <sadeep@asciimx.com> | 2025-05-06 06:42:47 +0800 |
|---|---|---|
| committer | Sadeep Madurange <sadeep@asciimx.com> | 2025-05-06 06:42:47 +0800 |
| commit | 50d1cb0c673ff55c6516c1264a54125db5d99f57 (patch) | |
| tree | 42f640e1185bfb40d05ee8b530f66130561a7e3e /fpm.c | |
| parent | 129fef686fff32e811b5f8394e881ca696e9b1b0 (diff) | |
| download | avr-fpm-drivers-50d1cb0c673ff55c6516c1264a54125db5d99f57.tar.gz | |
The damn R503 is responding!
Diffstat (limited to 'fpm.c')
| -rw-r--r-- | fpm.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -43,7 +43,7 @@ static inline void send(uint8_t pktid, uint8_t *data, uint8_t n) write_bulk(addr, 4); write(pktid); - pktlen = n + 2; + pktlen = n + 3; write((uint8_t)(pktlen >> 8)); write((uint8_t)pktlen); @@ -123,8 +123,22 @@ static inline uint8_t check_pwd(void) buf[4] = (uint8_t)((uint32_t)FPM_PWD & 0xFF); send(0x01, buf, 5); + recv(buf, &n); + return buf[0] == OK; +} + +static inline void uint8_t aura_on(void) +{ + unsigned int n; + uint8_t buf[MAXPDLEN]; + + buf[0] = 0x35; + buf[1] = 0x01; + buf[2] = 0x00; + buf[3] = 0x01; + buf[4] = 0x00; - n = 0; + send(0x01, buf, 5); recv(buf, &n); return buf[0] == OK; } @@ -142,6 +156,7 @@ uint8_t fpm_init(void) UCSR0C = (1 << UCSZ01) | (1 << UCSZ00); _delay_ms(RST_DELAY_MS); + aura_on(); return check_pwd(); } |
