]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/commitdiff
Fixed variable threshold digital inputs.
authorCarlos Jenkins <carlos@jenkins.co.cr>
Wed, 19 Jun 2013 18:05:59 +0000 (20:05 +0200)
committerCarlos Jenkins <carlos@jenkins.co.cr>
Wed, 19 Jun 2013 18:05:59 +0000 (20:05 +0200)
rpp/lib/apps/rpp-test-suite/src/din.c
rpp/lib/rpp/src/drv/dac.c
rpp/lib/rpp/src/drv/din.c

index c70250a670b8b9b208d027b66df9e1b3b8b89fdb..e22253731d71f9a871cea57f988fa72b94eedc76 100644 (file)
@@ -99,7 +99,7 @@ void test_din()
 {
     /// Configure module
     // Configure voltage reference
-    rpp_din_ref(2048, 2048);
+    rpp_din_ref(900, 900);
     // Configure pins
     int pin;
     for(pin = 1; pin <= 16; pin++) {
index dd2b29623a1d81a42c19a9237f1f8c57aae018a5..8228550c2df43f5939f6170bcc3acd613cd650ae 100644 (file)
 // Options:
 //   Bit 13: Output Gain Selection bit set = 1x (VOUT = VREF * D/4096)
 //   Bit 15: DACA (0) or DACB (1) Selection bit.
-#define DAC1_INIT_VAL   _BV(13)
-#define DAC2_INIT_VAL   _BV(13) | _BV(15)
-#define DAC3_INIT_VAL   _BV(13)
-#define DAC4_INIT_VAL   _BV(13) | _BV(15)
+#define DAC1_INIT_VAL   (_BV(13)          )
+#define DAC2_INIT_VAL   (_BV(13) | _BV(15))
+#define DAC3_INIT_VAL   (_BV(13)          )
+#define DAC4_INIT_VAL   (_BV(13) | _BV(15))
 
 /**
  * Pin status for each DAC pin, the structure of each field is defined
index 135bf68fe58769dcebeb7d67938615da369f892b..1cb26f879d4d77e2ba168e9d84b2d87ae203641d 100644 (file)
@@ -54,8 +54,8 @@ const static uint32_t dsc_pin_map[8U] = {
 // Options:
 //   Bit 13: Output Gain Selection bit set = 1x (VOUT = VREF * D/4096)
 //   Bit 15: DACA (0) or DACB (1) Selection bit.
-#define DACA_INIT_VAL   _BV(13)
-#define DACB_INIT_VAL   _BV(13) | _BV(15)
+#define DACA_INIT_VAL   (_BV(13) | _BV(12)          )
+#define DACB_INIT_VAL   (_BV(13) | _BV(12) | _BV(15))
 
 int8_t drv_din_ref(uint16_t ref_a, uint16_t ref_b)
 {