U.B.O.R
The [U]seless [B]ox [O]rganizing [R]obot. A FreeRTOS study project written in C which implements a multitasked control unit for a belt conveyor system with robotic sorting arms.
Data Structures | Macros | Functions | Variables
Display

Utility to control the display and log messages. More...

Data Structures

struct  log_message_t
 Structure to describe a log message. More...
 

Macros

#define STACKSIZE_TASK   ( 256 )
 Stack size of the display task. More...
 
#define PRIORITY_TASK   ( 3 )
 Priority of the Display task (low priority number denotes low priority task) More...
 
#define QUEUE_SIZE   10
 Size of the message queue. More...
 
#define DISPLAY_LINES   30
 Number of lines that fit on the display (vertically) More...
 
#define DISPLAY_CHARS   64
 Number of horizontal characters that can be displayed. More...
 

Functions

uint8_t display_log (uint8_t id, const char *fmtstr,...)
 Logs a message to the display global. More...
 
void display_init ()
 Initializes the display and starts the display task global. More...
 

Variables

uint8_t visible_messages =0
 Number of currently visible messages. More...
 
uint8_t buffer_offset = 0
 Offset in the message_buffer to get to the top message. More...
 
log_message_t message_buffer [DISPLAY_LINES]
 buffer of all visible messages (ring buffer!) More...
 

Detailed Description

Utility to control the display and log messages.

Macro Definition Documentation

◆ DISPLAY_CHARS

#define DISPLAY_CHARS   64

Number of horizontal characters that can be displayed.

Definition at line 44 of file display.c.

◆ DISPLAY_LINES

#define DISPLAY_LINES   30

Number of lines that fit on the display (vertically)

Definition at line 43 of file display.c.

◆ PRIORITY_TASK

#define PRIORITY_TASK   ( 3 )

Priority of the Display task (low priority number denotes low priority task)

Definition at line 39 of file display.c.

◆ QUEUE_SIZE

#define QUEUE_SIZE   10

Size of the message queue.

Definition at line 41 of file display.c.

◆ STACKSIZE_TASK

#define STACKSIZE_TASK   ( 256 )

Stack size of the display task.

Definition at line 38 of file display.c.

Function Documentation

◆ display_init()

void display_init ( )

Initializes the display and starts the display task global.

Returns
none

Definition at line 199 of file display.c.

Here is the caller graph for this function:

◆ display_log()

uint8_t display_log ( uint8_t  id,
const char *  fmtstr,
  ... 
)

Logs a message to the display global.

Parameters
[in]uint8_tid Message-ID to overwrite. Pass DISPLAY_NEWLINE to create a new message
[in]constchar* fmtstr Printf formatstring
[in]...Arguments for format specification
Returns
uint8_t Id of the message that was printed

Definition at line 70 of file display.c.

Variable Documentation

◆ buffer_offset

uint8_t buffer_offset = 0

Offset in the message_buffer to get to the top message.

Definition at line 143 of file display.c.

◆ message_buffer

log_message_t message_buffer[DISPLAY_LINES]

buffer of all visible messages (ring buffer!)

Definition at line 144 of file display.c.

◆ visible_messages

uint8_t visible_messages =0

Number of currently visible messages.

Definition at line 142 of file display.c.