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
|
@ -38,21 +38,21 @@ struct mb_display {
|
|||
|
||||
struct k_timer timer; /* Rendering timer */
|
||||
|
||||
uint8_t img_count; /* Image count */
|
||||
u8_t img_count; /* Image count */
|
||||
|
||||
uint8_t cur_img; /* Current image or character to show */
|
||||
u8_t cur_img; /* Current image or character to show */
|
||||
|
||||
uint8_t scroll:3, /* Scroll shift */
|
||||
u8_t scroll:3, /* Scroll shift */
|
||||
first:1, /* First frame of a scroll sequence */
|
||||
loop:1, /* Loop to beginning */
|
||||
text:1, /* We're showing a string (not image) */
|
||||
img_sep:1; /* One column image separation */
|
||||
|
||||
/* The following variables track the currently shown image */
|
||||
uint8_t cur; /* Currently rendered row */
|
||||
uint32_t row[3]; /* Content (columns) for each row */
|
||||
int64_t expiry; /* When to stop showing current image */
|
||||
int32_t duration; /* Duration for each shown image */
|
||||
u8_t cur; /* Currently rendered row */
|
||||
u32_t row[3]; /* Content (columns) for each row */
|
||||
s64_t expiry; /* When to stop showing current image */
|
||||
s32_t duration; /* Duration for each shown image */
|
||||
|
||||
union {
|
||||
const struct mb_image *img; /* Array of images to show */
|
||||
|
@ -64,7 +64,7 @@ struct mb_display {
|
|||
};
|
||||
|
||||
struct x_y {
|
||||
uint8_t x:4,
|
||||
u8_t x:4,
|
||||
y:4;
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,7 @@ static const struct x_y map[DISPLAY_ROWS][DISPLAY_COLS] = {
|
|||
};
|
||||
|
||||
/* Mask of all the column bits */
|
||||
static const uint32_t col_mask = (((~0UL) << LED_COL1_GPIO_PIN) &
|
||||
static const u32_t col_mask = (((~0UL) << LED_COL1_GPIO_PIN) &
|
||||
((~0UL) >> (31 - LED_COL9_GPIO_PIN)));
|
||||
|
||||
static inline const struct mb_image *get_font(char ch)
|
||||
|
@ -123,10 +123,10 @@ static void start_image(struct mb_display *disp, const struct mb_image *img)
|
|||
|
||||
#define ROW_PIN(n) (LED_ROW1_GPIO_PIN + (n))
|
||||
|
||||
static inline void update_pins(struct mb_display *disp, uint32_t val)
|
||||
static inline void update_pins(struct mb_display *disp, u32_t val)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_MICROBIT_DISPLAY_PIN_GRANULARITY)) {
|
||||
uint32_t pin, prev = (disp->cur + 2) % 3;
|
||||
u32_t pin, prev = (disp->cur + 2) % 3;
|
||||
|
||||
/* Disable the previous row */
|
||||
gpio_pin_write(disp->dev, ROW_PIN(prev), 0);
|
||||
|
@ -197,7 +197,7 @@ static inline bool last_frame(struct mb_display *disp)
|
|||
}
|
||||
}
|
||||
|
||||
static inline uint8_t scroll_steps(struct mb_display *disp)
|
||||
static inline u8_t scroll_steps(struct mb_display *disp)
|
||||
{
|
||||
return 5 + disp->img_sep;
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ static struct mb_display display = {
|
|||
.timer = K_TIMER_INITIALIZER(display.timer, show_row, clear_display),
|
||||
};
|
||||
|
||||
static void start_scroll(struct mb_display *disp, int32_t duration)
|
||||
static void start_scroll(struct mb_display *disp, s32_t duration)
|
||||
{
|
||||
/* Divide total duration by number of scrolling steps */
|
||||
if (duration) {
|
||||
|
@ -300,7 +300,7 @@ static void start_scroll(struct mb_display *disp, int32_t duration)
|
|||
start_image(disp, get_font(' '));
|
||||
}
|
||||
|
||||
static void start_single(struct mb_display *disp, int32_t duration)
|
||||
static void start_single(struct mb_display *disp, s32_t duration)
|
||||
{
|
||||
disp->duration = duration;
|
||||
|
||||
|
@ -311,8 +311,8 @@ static void start_single(struct mb_display *disp, int32_t duration)
|
|||
}
|
||||
}
|
||||
|
||||
void mb_display_image(struct mb_display *disp, uint32_t mode, int32_t duration,
|
||||
const struct mb_image *img, uint8_t img_count)
|
||||
void mb_display_image(struct mb_display *disp, u32_t mode, s32_t duration,
|
||||
const struct mb_image *img, u8_t img_count)
|
||||
{
|
||||
reset_display(disp);
|
||||
|
||||
|
@ -343,8 +343,8 @@ void mb_display_stop(struct mb_display *disp)
|
|||
reset_display(disp);
|
||||
}
|
||||
|
||||
void mb_display_print(struct mb_display *disp, uint32_t mode,
|
||||
int32_t duration, const char *fmt, ...)
|
||||
void mb_display_print(struct mb_display *disp, u32_t mode,
|
||||
s32_t duration, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue