summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--software/rda1846dongle/rda1846.c4
-rw-r--r--software/rda1846dongle/rda1846_defines.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/software/rda1846dongle/rda1846.c b/software/rda1846dongle/rda1846.c
index 3b89f2a..bd68710 100644
--- a/software/rda1846dongle/rda1846.c
+++ b/software/rda1846dongle/rda1846.c
@@ -79,7 +79,7 @@ static uint8_t rda1846_read_register_raw(const uint8_t addr, uint16_t* data)
i2c_error:
TWI_StopTransmission();
- printf("I2C error (write_register_raw)\r\n");
+ printf("I2C error (read_register_raw)\r\n");
return 1;
}
@@ -296,7 +296,7 @@ uint16_t rda1846_get_flags(void)
if(rda1846_read_register(RDA1846_REG_FLAG, &data))
return 0xFFFF;
- return data & 0x1687;
+ return data & RDA1846_FLAGS_MASK;
}
uint16_t rda1846_get_dtmf(uint8_t* idx1, uint8_t* idx2, uint8_t* code, uint8_t* valid)
diff --git a/software/rda1846dongle/rda1846_defines.h b/software/rda1846dongle/rda1846_defines.h
index e6fca56..616ee43 100644
--- a/software/rda1846dongle/rda1846_defines.h
+++ b/software/rda1846dongle/rda1846_defines.h
@@ -114,6 +114,8 @@
#define RDA1846_FLAG_SQ 0x0002
#define RDA1846_FLAG_VOX 0x0001
+#define RDA1846_FLAGS_MASK 0x1687
+
// gpio
#define RDA1846_GPIO_7_HI_Z 0x0000