Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Temperature.h
Go to the documentation of this file.
1
7#pragma once
8
9//#include "nrf_soc.h"
10
11#include <ble/cs_Nordic.h>
12
13#include "util/cs_BleError.h"
14
21inline int32_t getTemperature() {
22 int32_t temperature;
23 uint32_t nrfCode = sd_temp_get(&temperature);
24 // This function only has success as return code.
25 APP_ERROR_CHECK(nrfCode);
26
27 temperature = (temperature / 4);
28 return temperature;
29}
#define APP_ERROR_CHECK(cs_ret_code_t)
Macro for calling error handler function if supplied error code any other than NRF_SUCCESS.
Definition: cs_BleError.h:61
int32_t getTemperature()
Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: Oct 23,...
Definition: cs_Temperature.h:21