MLX90393, SPI, and Changing Resoultion

First the code:

#include "esp_system.h" //This inclusion configures the peripherals in the ESP system.
// #include "ESP32_LSM9DS1.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/timers.h"
#include "freertos/event_groups.h"
////
#include "ESP32_SPI_API.h"
////////////////////////////////////////////////////
/* create event group */
EventGroupHandle_t eg;
/* define event bits */
// #define evt ( 1 << 0 ) // 1
// #define evt ( 1 << 1 ) // 10
#define evtfMLX90393_ReadSensor_0          ( 1 << 2 ) // 100
#define evtfMLX90393_ReadSensor_1          ( 1 << 3 ) // 1000
#define evtTriggerMLX90393_1               ( 1 << 4 ) // 10000
////////////////////////////////////////////////////
#define TaskCore1 1
#define TaskCore0 0
#define SerialDataBits 115200
#define TaskStack10K 10000
#define TaskStack30K 30000
#define Priority4 4
///////////////////////////////////////////////////
TickType_t xSemaphoreTicksToWait = 500;
///////////////////////////////////////////
#define MLX90393_AXIS_ALL       (0x0F)  // X+Y+Z+T axis bits for commands
// registers
#define MLX90393_CONF1          (0x00)  // Gain
#define MLX90393_CONF2          (0x01)  // Burst, comm mode, trigger interrupt, 
#define MLX90393_CONF3          (0x02)  // Oversampling, filter, res.
#define MLX90393_CONF4          (0x03)  // Sensitivty drift.
#define MLX90393_GAIN_SHIFT     (0x04)  // Left-shift for gain bits. 


#define MLX90393_HALL_CONF      (0x0C)  // Hall plate spinning rate adj.
#define MLX90393_STATUS_OK      (0x00)  // OK value for status response. 
#define MLX90393_STATUS_MASK    (0xFC)  // Mask for status OK checks.
// commands
#define MLX90393_REG_SB (0x10) // Start burst mode.
#define MLX90393_REG_SW (0x20) // Start wakeup on change mode.
#define MLX90393_REG_SM (0x30) // Start single-meas mode. 
#define MLX90393_REG_RM (0x40) // Read measurement
#define MLX90393_REG_RR (0x50) // Read register.
#define MLX90393_REG_WR (0x60) // Write Register.
#define MLX90393_REG_EX (0x80) // Exit moode
#define MLX90393_REG_HR (0xD0) // Memory recall
#define MLX90393_REG_HS (0x70) // Memory store
#define MLX90393_REG_RT (0xF0) // Reset
#define MLX90393_REG_NOP (0x00) // NOP
/** Gain settings for CONF1 register. */
uint8_t    MLX90393_GAIN_5X     = (0x00);
uint8_t    MLX90393_GAIN_4X = (0x01);
uint8_t    MLX90393_GAIN_3X = (0x02);
uint8_t    MLX90393_GAIN_2_5X = (0x03);
uint8_t    MLX90393_GAIN_2X = (0x04);
uint8_t    MLX90393_GAIN_1_67X = (0x05);
uint8_t    MLX90393_GAIN_1_33X = (0x06);
uint8_t    MLX90393_GAIN_1X = (0x07);
//
//#define MLX90393_RES_2_15 (0x00) // Resolution (2^15) - 0.
//#define MLX90393_RES_2_16 (0x01) // Resolution (2^16) - 1.
//#define MLX90393_RES_2_17 (0x02) // Resolution (2^17) - 3.
//#define MLX90393_RES_2_18 (0x03) // Resolution (2^18) - 7.
///////////////////////////////////////////
//SemaphoreHandle_t sema_fMLX90393_1;
//SemaphoreHandle_t sema_MLX90393readSensorTrigger;
//SemaphoreHandle_t sema_triggerEvent;
///////////////////////////////////////////
#define csPinMLX90393_0 32
#define csPinMLX90393_1 5
#define spiCLK 25 // 
#define spiMOSI 26 // 
#define spiMISO 27 // 
#define MLX90393int_0 18
#define MLX90393int_1 4
spi_device_handle_t _hMLX90393_0;
spi_device_handle_t _hMLX90393_1;
//////////////////////////////////////////
TickType_t xTicksToWait0 = 0;
//////////////////////////////////////////
/** Lookup table to convert (typical)raw values to uT based on gain and res.
   each gain setting has 4 resoultions
   numbered from left to right
   res=0, res=1, res=2, res=3
   first value is gain for X/Y 2nd value is gain for Z
*/
const float mlx90393_lsb_lookup[8][4][2] = {
  /* 5x gain */
  {{0.805, 1.468}, {1.610, 2.936}, {3.220, 5.872}, {6.440, 11.744}},
  /* 4x gain */
  {{0.644, 1.174}, {1.288, 2.349}, {2.576, 4.698}, {5.152, 9.395}},
  /* 3x gain */
  {{0.483, 0.881}, {0.966, 1.762}, {1.932, 3.523}, {3.864, 7.046}},
  /* 2.5x gain */
  {{0.403, 0.734}, {0.805, 1.468}, {1.610, 2.936}, {3.220, 5.872}},
  /* 2x gain */
  {{0.322, 0.587}, {0.644, 1.174}, {1.288, 2.349}, {2.576, 4.698}},
  /* 1.667x gain */
  {{0.268, 0.489}, {0.537, 0.979}, {1.073, 1.957}, {2.147, 3.915}},
  /* 1.333x gain */
  {{0.215, 0.391}, {0.429, 0.783}, {0.859, 1.566}, {1.717, 3.132}},
  /* 1x gain */
  {{0.161, 0.294}, {0.322, 0.587}, {0.644, 1.174}, {1.288, 2.349}}
};
//////////////////////////////////////////
struct stuMagCompensation
{
  float x = 0.0f;
  float y = 0.0f;
  float z = 0.0f;
} xMag;
//////////////////////////////////////////
void IRAM_ATTR fMLX90393_triggerReadSensor_0( )
{
  BaseType_t xHigherPriorityTaskWoken;
  xEventGroupSetBitsFromISR(eg, evtfMLX90393_ReadSensor_0, &xHigherPriorityTaskWoken);
}
//////////////////////////////////////////
void setup()
{
  pinMode( MLX90393int_0, INPUT );
  Serial.begin( SerialDataBits );
  eg = xEventGroupCreate();
  if ( fInitializeSPI_Channel( spiCLK, spiMOSI, spiMISO, HSPI_HOST, true) != 0 )
  {
    Serial.println ( "fInitializeSPI_Channel error " );
  }
  if ( fInitializeSPI_Devices( _hMLX90393_0, csPinMLX90393_0 ) != 0 )
  {
    Serial.print ( "fInitializeSPI_Device MLX90393 error " );
  }
  /////////////////// CORE 0 ////////////////////////////////////////////////////////////////////////////////
  xTaskCreatePinnedToCore ( fMLX90393_0, "fMLX90393_0", TaskStack30K, NULL, Priority4, NULL, TaskCore0 );
}
//////////////////////////////////////////////////////////
void loop() {}
//////////////////////////////////////////////////////////
////
// input 0,1,2,3 for resolution settings
void fMLX90393_ChangeResoultion( spi_device_handle_t &hM, int xyz_res )
{
  int rx[3] = { 0 };
  uint16_t _res = (((uint8_t)xyz_res & 0x3) << 4) | (((uint8_t)xyz_res & 0x3) << 2) | ((uint8_t)xyz_res & 0x3);
  // read config3 register
  fReadSPIdataXbits( hM, (MLX90393_CONF3 & 0x3f) << 2, rx, 3 );
  uint16_t workingValue = ( rx[2] << 8 ) | rx[1];
  uint16_t RES_XYZ_MASK = 0x07e0, RES_XYZ_SHIFT = 5;
  // create bits for conversion to values needed
  // 6 bits, 2 bits per plane, Z bits MSB, y the middle bits, x LSB
  workingValue = ( workingValue & ~RES_XYZ_MASK) | ( _res << RES_XYZ_SHIFT ) & RES_XYZ_MASK ;
  // split 16 bit into 2 8 bits
  rx[0] = workingValue & 0xFF; // low byte
  workingValue = workingValue >> 8;
  //  Serial.print( " working value: " );
  //  Serial.print( workingValue, BIN );
  rx[1] = workingValue & 0xFF;
  //
  //   Serial.print ( " bit split: " );
  //    Serial.print( rx[1], BIN );
  //    Serial.print ( " / " );
  //   Serial.print( rx[0], BIN );
  //
  fWriteSPIdata32bits( hM, MLX90393_REG_WR, rx[0], rx[1], (MLX90393_CONF3 & 0x3F) << 2 );
}
/////////////////////////////////////////////////////////
void fMLX90393_0( void * pvParameters )
{
  int rx[10] = { 0 };
  int _gain = MLX90393_GAIN_1X;
  int xyResoultion = 0;
  int zResoultion = 1;
  int xRes;
  int yRes;
  int zRes;
  float xAverage = 0.0f;

  esp_err_t intError;
  intError = fWriteSPIdata8bits2( _hMLX90393_0, MLX90393_REG_RT ); // reset
  vTaskDelay( 300 ); // allow reset time to complete
  // set gain
  intError = fWriteSPIdata32bits( _hMLX90393_0, MLX90393_REG_WR, 0x00, (((_gain & 0x7) << MLX90393_GAIN_SHIFT) | MLX90393_HALL_CONF), (MLX90393_CONF1 & 0x3F) << 2 );
  if ( intError != 0 )
  {
    Serial.print( "error with set gain:" );
    Serial.println ( intError );
  }
  vTaskDelay( 10 );
  // MLX90393_CONF2 for comm mode TRIG_INT_SEL 0x1 + 0x10 use spi + relative measurement 0x1 + temp compensation 0x1 = 0xD0
  intError = fWriteSPIdata32bits( _hMLX90393_0, MLX90393_REG_WR, 0x00, 0xD0, (MLX90393_CONF2 & 0x3f) << 2 ); // using 0x00 for the lower 8 bits of the register
  vTaskDelay( 10 );
  fReadSPIdataXbits( _hMLX90393_0, (MLX90393_CONF2 & 0x3f) << 2, rx, 3 );
  fMLX90393_ChangeResoultion( _hMLX90393_0, 0 );
  vTaskDelay( 10 );
  // read MLX90393_CONF3 for resolution
  intError = fReadSPIdataXbits( _hMLX90393_0, (MLX90393_CONF3 & 0x3f) << 2, rx, 3 );
  // transform response into 16bit
  int temp = ( rx[2] << 8) | rx[1];
  // find resoultion being used
  temp = temp >> 5;
  // extract 1st 2 bits, x resolution
  xRes = temp & 3;
  temp = temp >> 2;
  yRes = temp & 3;
  temp = temp >> 2;
  zRes = temp & 3;
  Serial.print ( zRes, BIN );
  Serial.print ( " " );
  Serial.print ( yRes, BIN );
  Serial.print ( " " );
  Serial.print ( xRes, BIN );
  Serial.println ( );
  TickType_t xLastWakeTime;
  const TickType_t xFrequency = pdMS_TO_TICKS( 70 );
  xLastWakeTime = xTaskGetTickCount();
  //attaching the interrupt to microcontroller pin
  attachInterrupt( MLX90393int_0, fMLX90393_triggerReadSensor_0, RISING );
  while (1)
  {
    vTaskDelayUntil( &xLastWakeTime, xFrequency );
// code removed to lower character count
  }
  vTaskDelete(NULL);
}

I have not been able to change the resolution using the fMLX90393_ChangeResoultion( spi_device_handle_t &hM, int xyz_res ) function. I do not get an error. If you have an idea why the MLX90393_CONF3 register is not changing, I am quite open to suggestions.

I am able to change the other registers but not CONF3.