drivers: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99 integer types. Jira: ZEP-2051 Change-Id: I08f51e2bfd475f6245771c1bd2df7ffc744c48c4 Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
e547533435
commit
ccad5bf3e3
231 changed files with 3200 additions and 3200 deletions
|
@ -9,7 +9,7 @@
|
|||
#include <misc/__assert.h>
|
||||
|
||||
/* Sample period in microseconds, indexed by output data rate encoding (DR) */
|
||||
static const uint32_t sample_period[] = {
|
||||
static const u32_t sample_period[] = {
|
||||
1250, 2500, 5000, 10000, 20000, 40000, 80000, 80000
|
||||
};
|
||||
|
||||
|
@ -17,8 +17,8 @@ static int fxas21002_sample_fetch(struct device *dev, enum sensor_channel chan)
|
|||
{
|
||||
const struct fxas21002_config *config = dev->config->config_info;
|
||||
struct fxas21002_data *data = dev->driver_data;
|
||||
uint8_t buffer[FXAS21002_MAX_NUM_BYTES];
|
||||
int16_t *raw;
|
||||
u8_t buffer[FXAS21002_MAX_NUM_BYTES];
|
||||
s16_t *raw;
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
|
@ -53,10 +53,10 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void fxas21002_convert(struct sensor_value *val, int16_t raw,
|
||||
static void fxas21002_convert(struct sensor_value *val, s16_t raw,
|
||||
enum fxas21002_range range)
|
||||
{
|
||||
int32_t micro_rad;
|
||||
s32_t micro_rad;
|
||||
|
||||
/* Convert units to micro radians per second.*/
|
||||
micro_rad = (raw * 62500) >> range;
|
||||
|
@ -72,7 +72,7 @@ static int fxas21002_channel_get(struct device *dev, enum sensor_channel chan,
|
|||
struct fxas21002_data *data = dev->driver_data;
|
||||
int start_channel;
|
||||
int num_channels;
|
||||
int16_t *raw;
|
||||
s16_t *raw;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
|
@ -129,7 +129,7 @@ int fxas21002_get_power(struct device *dev, enum fxas21002_power *power)
|
|||
{
|
||||
const struct fxas21002_config *config = dev->config->config_info;
|
||||
struct fxas21002_data *data = dev->driver_data;
|
||||
uint8_t val = *power;
|
||||
u8_t val = *power;
|
||||
|
||||
if (i2c_reg_read_byte(data->i2c, config->i2c_address,
|
||||
FXAS21002_REG_CTRLREG1,
|
||||
|
@ -154,11 +154,11 @@ int fxas21002_set_power(struct device *dev, enum fxas21002_power power)
|
|||
power);
|
||||
}
|
||||
|
||||
uint32_t fxas21002_get_transition_time(enum fxas21002_power start,
|
||||
u32_t fxas21002_get_transition_time(enum fxas21002_power start,
|
||||
enum fxas21002_power end,
|
||||
uint8_t dr)
|
||||
u8_t dr)
|
||||
{
|
||||
uint32_t transition_time;
|
||||
u32_t transition_time;
|
||||
|
||||
/* If not transitioning to active mode, then don't need to wait */
|
||||
if (end != FXAS21002_POWER_ACTIVE) {
|
||||
|
@ -183,9 +183,9 @@ static int fxas21002_init(struct device *dev)
|
|||
{
|
||||
const struct fxas21002_config *config = dev->config->config_info;
|
||||
struct fxas21002_data *data = dev->driver_data;
|
||||
uint32_t transition_time;
|
||||
uint8_t whoami;
|
||||
uint8_t ctrlreg1;
|
||||
u32_t transition_time;
|
||||
u8_t whoami;
|
||||
u8_t ctrlreg1;
|
||||
|
||||
/* Get the I2C device */
|
||||
data->i2c = device_get_binding(config->i2c_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue