Skip to content

Commit

Permalink
allow changing bar colour of the progress-bar-drill
Browse files Browse the repository at this point in the history
  • Loading branch information
GorgonMeducer committed Nov 4, 2023
1 parent 3b3a3c4 commit 31700ea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/common/controls/progress_bar_drill.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void progress_bar_drill_init(void)
void __progress_bar_drill_show( const arm_2d_tile_t *ptTarget,
const arm_2d_region_t *ptRegion,
int_fast16_t iProgress,
COLOUR_INT tBarColour,
bool bIsNewFrame)
{
assert(NULL != ptTarget);
Expand Down Expand Up @@ -177,7 +178,7 @@ void __progress_bar_drill_show( const arm_2d_tile_t *ptTarget,
tBarRegion.tSize.iWidth = tBarRegion.tSize.iWidth * (int16_t)iProgress / 1000;

//! draw the inner stripe
arm_2d_fill_colour(ptTarget, &tBarRegion, GLCD_COLOR_YELLOW);
arm_2d_fill_colour(ptTarget, &tBarRegion, tBarColour);
arm_2d_op_wait_async(NULL);
}

Expand Down
14 changes: 14 additions & 0 deletions examples/common/controls/progress_bar_drill.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

/*============================ INCLUDES ======================================*/
#include "arm_2d.h"
#include "__common.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -29,13 +30,25 @@ extern "C" {
/*============================ MACROS ========================================*/
/*============================ MACROFIED FUNCTIONS ===========================*/

#define progress_bar_drill_show5( __target_ptr, \
__region_ptr, \
__progress, \
__colour, \
__is_new_frame) \
__progress_bar_drill_show( (__target_ptr), \
(__region_ptr), \
(int_fast16_t)(__progress), \
(__colour), \
(__is_new_frame))

#define progress_bar_drill_show4( __target_ptr, \
__region_ptr, \
__progress, \
__is_new_frame) \
__progress_bar_drill_show( (__target_ptr), \
(__region_ptr), \
(int_fast16_t)(__progress), \
(GLCD_COLOR_YELLOW), \
(__is_new_frame))

#define progress_bar_drill_show3( __target_ptr, \
Expand Down Expand Up @@ -80,6 +93,7 @@ extern
void __progress_bar_drill_show( const arm_2d_tile_t *ptTarget,
const arm_2d_region_t *ptRegion,
int_fast16_t iProgress,
COLOUR_INT tBarColour,
bool bIsNewFrame);

#ifdef __cplusplus
Expand Down

0 comments on commit 31700ea

Please sign in to comment.