#include <math.h>
#include "tools.h"

//µçÑ¹»»Ëã³ÉÎÂ¶È
float ntc_data(float vol)
{
   float temp = 0;

   float Rt = 0;
   float Rp = 10000;
   float T2 = 273.15+25;
   float Bx = 3950;
   float Ka = 273.15;
   Rt = vol * 10000.0 / (3300.0 - vol);
   temp = 1 / (1 / T2 + log(Rt / Rp) / Bx) - Ka + 0.5;
   return temp;
}

//Òì»ò
uint8_t xor_data(uint8_t *data, int len)
{
  uint8_t value = *data;

  for(int i = 1; i < len; i++)
  {
      value = value ^ data[i];
  }

  return value;
}

void rng_init(uint32_t seed)
{
//  srand(seed);
}

uint32_t Get_Rand(void)
{
  return (uint32_t)tmos_rand();
}
