-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SUKU lcd element created, vsnx hwcfg trick removed
- Loading branch information
Showing
9 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "grid_ui_lcd.h" | ||
|
||
#include "grid_ain.h" | ||
#include "grid_lua_api.h" | ||
#include "grid_protocol.h" | ||
#include "grid_ui.h" | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
extern uint8_t grid_platform_get_adc_bit_depth(); | ||
|
||
extern void grid_platform_printf(char const* fmt, ...); | ||
|
||
const char grid_ui_lcd_init_actionstring[] = GRID_ACTIONSTRING_LCD_INIT; | ||
|
||
void grid_ui_element_lcd_init(struct grid_ui_element* ele) { | ||
|
||
ele->type = GRID_PARAMETER_ELEMENT_LCD; | ||
|
||
ele->event_list_length = 1; | ||
|
||
ele->event_list = malloc(ele->event_list_length * sizeof(struct grid_ui_event)); | ||
grid_ui_event_init(ele, 0, GRID_PARAMETER_EVENT_INIT, GRID_LUA_FNC_A_INIT_short, grid_ui_lcd_init_actionstring); // Element Initialization Event | ||
|
||
ele->template_initializer = &grid_ui_element_lcd_template_parameter_init; | ||
ele->template_parameter_list_length = GRID_LUA_FNC_L_LIST_length; | ||
|
||
ele->event_clear_cb = NULL; | ||
ele->page_change_cb = NULL; | ||
} | ||
|
||
void grid_ui_element_lcd_template_parameter_init(struct grid_ui_template_buffer* buf) { | ||
|
||
// printf("template parameter init\r\n"); | ||
|
||
uint8_t element_index = buf->parent->index; | ||
int32_t* template_parameter_list = buf->template_parameter_list; | ||
|
||
template_parameter_list[GRID_LUA_FNC_L_ELEMENT_INDEX_index] = element_index; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#ifndef GRID_UI_LCD_H_INCLUDED | ||
#define GRID_UI_LCD_H_INCLUDED | ||
|
||
#include "grid_ui.h" | ||
#include <stdint.h> | ||
|
||
void grid_ui_element_lcd_init(struct grid_ui_element* ele); | ||
|
||
void grid_ui_element_lcd_template_parameter_init(struct grid_ui_template_buffer* buf); | ||
|
||
#define GRID_LUA_FNC_L_ELEMENT_INDEX_index 0 | ||
#define GRID_LUA_FNC_L_ELEMENT_INDEX_helper "0" | ||
#define GRID_LUA_FNC_L_ELEMENT_INDEX_short "ind" | ||
#define GRID_LUA_FNC_L_ELEMENT_INDEX_human "element_index" | ||
|
||
#define GRID_LUA_FNC_L_LIST_length 1 | ||
|
||
// LCD init function | ||
#define GRID_LUA_LCD_META_init \ | ||
"lcd_meta = { __index = { \ | ||
\ | ||
" GRID_LUA_FNC_L_ELEMENT_INDEX_short "=function (self,a) return " \ | ||
"gtv(self.index, " GRID_LUA_FNC_L_ELEMENT_INDEX_helper ", a) end, \ | ||
\ | ||
" GRID_LUA_FNC_A_INIT_short " = function (self) print('undefined action') end, \ | ||
\ | ||
gtt = function (self,a) " GRID_LUA_FNC_G_TIMER_START_short "(self.index,a) end,\ | ||
gtp = function (self) " GRID_LUA_FNC_G_TIMER_STOP_short "(self.index) end,\ | ||
get = function (self,a) " GRID_LUA_FNC_G_EVENT_TRIGGER_short "(self.index,a) end\ | ||
}}" | ||
|
||
#define GRID_ACTIONSTRING_LCD_INIT "<?lua --[[@cb]] --[[lcd init]] ?>" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters