/* Update the ODR setting of the flash buffer.  */
static int32_t cn0503_flash_write_odr(struct cn0503_dev *dev, uint8_t *arg, uint8_t *buff)
/* Update the ODR setting of the flash buffer.  */
static int32_t cn0503_flash_write_odr(struct cn0503_dev *dev, uint8_t *arg, uint8_t *buff)
{
	uint8_t *error, odr_thresh;
	float check_val, temp;
	check_val = strtod((char *)arg, (char **)&error);
	if(error == arg)
		return FAILURE;
	odr_thresh = (float)(CN0503_CODE_ODR_DEFAULT / CN0503_BLOCK_FILT_SIZE) /
		     check_val;
	do {
		temp = (float)(CN0503_CODE_ODR_DEFAULT / CN0503_BLOCK_FILT_SIZE) /
		       odr_thresh;
		odr_thresh++;
	} while (temp > check_val);
	sprintf((char *)buff, "%.2f", temp);
	memcpy((void *)&dev->sw_flash_buffer[CN0503_FLASH_ODR_IDX],
	       (void *)&temp, 4);
	return SUCCESS;
}