From 7a2a5d3c77554c37ee906f4979b36ff589d00442 Mon Sep 17 00:00:00 2001 From: schneider <schneider@blinkenlichts.net> Date: Sat, 11 Apr 2020 04:17:43 +0200 Subject: [PATCH] fix(max86150): Fix a few register accesses related to averaging --- lib/vendor/Maxim/MAX86150/max86150.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/vendor/Maxim/MAX86150/max86150.c b/lib/vendor/Maxim/MAX86150/max86150.c index 7af45af57..685dae5af 100644 --- a/lib/vendor/Maxim/MAX86150/max86150.c +++ b/lib/vendor/Maxim/MAX86150/max86150.c @@ -35,7 +35,7 @@ static const uint8_t MAX86150_FIFOCONTROL2 = 0x0A; static const uint8_t MAX86150_SYSCONTROL = 0x0D; static const uint8_t MAX86150_PPGCONFIG1 = 0x0E; static const uint8_t MAX86150_PPGCONFIG2 = 0x0F; -static const uint8_t MAX86150_LED_PROX_AMP = 0x10; +static const uint8_t MAX86150_PROXINTTHRESH = 0x10; static const uint8_t MAX86150_LED1_PULSEAMP = 0x11; static const uint8_t MAX86150_LED2_PULSEAMP = 0x12; @@ -44,7 +44,6 @@ static const uint8_t MAX86150_LED_PILOT_PA = 0x15; static const uint8_t MAX86150_ECG_CONFIG1 = 0x3C; static const uint8_t MAX86150_ECG_CONFIG3 = 0x3E; -static const uint8_t MAX86150_PROXINTTHRESH = 0x10; static const uint8_t MAX86150_PARTID = 0xFF; @@ -65,7 +64,7 @@ static const uint8_t MAX86150_INT_PROX_INT_MASK = (byte)~0b00010000; static const uint8_t MAX86150_INT_PROX_INT_ENABLE = 0x10; static const uint8_t MAX86150_INT_PROX_INT_DISABLE = 0x00; -static const uint8_t MAX86150_SAMPLEAVG_MASK = (byte)~0b00000111; +static const uint8_t MAX86150_SMP_AVE_MASK = (byte)~0b00000111; static const uint8_t MAX86150_ROLLOVER_MASK = (byte)~0b00010000; static const uint8_t MAX86150_ROLLOVER_ENABLE = 0b00010000; @@ -337,7 +336,7 @@ void max86150_set_led_ir_amplitude(uint8_t amplitude) void max86150_set_led_proximity_amplitude(uint8_t amplitude) { max86150_write_register( - MAX86150_ADDRESS, MAX86150_LED_PROX_AMP, amplitude + MAX86150_ADDRESS, MAX86150_LED_PILOT_PA, amplitude ); } @@ -400,7 +399,7 @@ void max86150_disableSlots(void) void max86150_set_ppg_averaging(uint8_t numberOfSamples) { max86150_bit_mask( - MAX86150_FIFOCONFIG, MAX86150_SAMPLEAVG_MASK, numberOfSamples + MAX86150_PPGCONFIG2, MAX86150_SMP_AVE_MASK, numberOfSamples ); } -- GitLab