+
+static uint8_t badge_framebuffer_render_number_with_fd(badge_framebuffer *fb, int8_t *pos_x, int8_t pos_y, uint8_t number, FIL *fd) {
+ if(number >= 10) {
+ badge_framebuffer_render_number_with_fd(fb, pos_x, pos_y, number / 10, fd);
+ }
+
+ uint8_t err = badge_framebuffer_render_char_with_fd(fb, *pos_x, pos_y, '0' + number % 10, fd);
+
+ if(err != 0) return err;
+
+ *pos_x += BADGE_FONT_WIDTH;
+ return 0;
+}
+
+uint8_t badge_framebuffer_render_number(badge_framebuffer *fb, int8_t pos_x, int8_t pos_y, uint8_t number) {
+ FIL fd;
+
+ if(FR_OK == open_font_file(&fd)) {
+ uint8_t err = badge_framebuffer_render_number_with_fd(fb, &pos_x, pos_y, number, &fd);
+
+ if(err != 0) {
+ return err;
+ }
+ }
+
+ return 0;
+}