Skip to content

Commit 90ee037

Browse files
committed
kconfig: add CUBE0414 layer direction option
1 parent 1e2d343 commit 90ee037

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

main/Kconfig.projbuild

+17
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,23 @@ choice AUDIO_INPUT_FFT_CHANNEL
215215
bool "Both Channel"
216216
endchoice
217217

218+
choice CUBE0414_LAYER_DIR
219+
prompt "CUBE0414 Layer Direction"
220+
default CUBE0414_LAYER_H
221+
depends on ENABLE_VFX && VFX_OUTPUT_CUBE0414
222+
help
223+
Select CUBE0414 layer direction.
224+
225+
config CUBE0414_LAYER_H
226+
bool "Horizontal"
227+
config CUBE0414_LAYER_H_XYI
228+
bool "Horizontal XY-Inverted"
229+
config CUBE0414_LAYER_V
230+
bool "Vertical"
231+
config CUBE0414_LAYER_V_XYI
232+
bool "Vertical XY-Inverted"
233+
endchoice
234+
218235
choice CUBE0414_LINE_TYPE
219236
prompt "CUBE0414 Line Type"
220237
default CUBE0414_LINE_S_CURVE

main/src/user/vfx_core.c

+20
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,28 @@ uint32_t vfx_get_color(float color_h, float color_l)
7070
void vfx_draw_pixel(uint8_t x, uint8_t y, uint8_t z, float color_h, float color_l)
7171
{
7272
uint32_t pixel_color = vfx_get_color(color_h, color_l);
73+
74+
#ifdef CONFIG_VFX_OUTPUT_CUBE0414
75+
#ifdef CONFIG_CUBE0414_LAYER_H
76+
uint8_t pixel_x = x + y * 8;
77+
uint8_t pixel_y = z;
78+
#endif
79+
#ifdef CONFIG_CUBE0414_LAYER_H_XYI
80+
uint8_t pixel_x = (7 - x) + (7 - y) * 8;
81+
uint8_t pixel_y = z;
82+
#endif
83+
#ifdef CONFIG_CUBE0414_LAYER_V
84+
uint8_t pixel_x = x + z * 8;
85+
uint8_t pixel_y = y;
86+
#endif
87+
#ifdef CONFIG_CUBE0414_LAYER_V_XYI
88+
uint8_t pixel_x = (7 - x) + (7 - z) * 8;
89+
uint8_t pixel_y = y;
90+
#endif
91+
#else
7392
uint8_t pixel_x = x + y * 8;
7493
uint8_t pixel_y = z;
94+
#endif
7595

7696
#ifdef CONFIG_VFX_OUTPUT_CUBE0414
7797
gdispGDrawPixel(vfx_gdisp, pixel_x, pixel_y, pixel_color);

0 commit comments

Comments
 (0)