43 lines
662 B
C
43 lines
662 B
C
/*
|
|
* temp_ui.c: temporary ui shit until I can write something better
|
|
*/
|
|
|
|
#include "ch32x035_conf.h"
|
|
#include "btn.h"
|
|
|
|
#include "led/matrix.h"
|
|
|
|
|
|
|
|
static uint32_t brt = 28;
|
|
|
|
|
|
|
|
void brt_set(uint8_t idx)
|
|
{
|
|
switch (idx) {
|
|
case 1: {
|
|
if (brt > 4)
|
|
brt--;
|
|
break;
|
|
}
|
|
case 2: {
|
|
brt++;
|
|
if (brt > 44) brt = 44;
|
|
break;
|
|
}
|
|
}
|
|
|
|
aw20x_set_dim_global(&awled, brt);
|
|
}
|
|
|
|
void tempui_init()
|
|
{
|
|
btn[2].cb_push = brt_set;
|
|
btn[2].cb_hold = brt_set;
|
|
btn[2].repeat = 200;
|
|
|
|
btn[1].cb_push = brt_set;
|
|
btn[1].cb_hold = brt_set;
|
|
btn[1].repeat = 200;
|
|
} |