/* Attempt to add a callback to a set.  */
static Ecode_t addCallback(TEMPDRV_CallbackSet_t *set, int8_t temp, TEMPDRV_Callback_t callback)
/* Attempt to add a callback to a set.  */
static Ecode_t addCallback(TEMPDRV_CallbackSet_t *set, int8_t temp, TEMPDRV_Callback_t callback)
{
  int8_t index = findCallbackSpace(set);
  if (index < 0)
  {
    return ECODE_EMDRV_TEMPDRV_NO_SPACE;
  }
  set[index].temp = convertToEmu(temp);
  set[index].callback = callback;
  updateInterrupts();
  return ECODE_EMDRV_TEMPDRV_OK;
}