Add cli argument to select framebuffer device, still defaulting to /dev/fb0
This commit is contained in:
parent
fe27f89b53
commit
c19b3b776f
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,10 @@
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32_t disp_height;
|
||||
extern uint32_t disp_width;
|
||||
|
||||
@ -14,3 +18,7 @@ uint32_t disp_hpercent_to_px(uint32_t percent);
|
||||
uint32_t disp_vpercent_to_px(uint32_t percent);
|
||||
int lvgl_fb_run(const char* const fb_dev);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
#include "lvgl_port/lvgl_fb_port.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
return lvgl_fb_run("/dev/fb0");
|
||||
}
|
||||
|
33
src/main.cpp
Normal file
33
src/main.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#include <argparser.h>
|
||||
|
||||
#include "lvgl_port/lvgl_fb_port.h"
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
using namespace Cam::Arguments;
|
||||
|
||||
Parser argParser("calzone_ui");
|
||||
argParser.set_description("LVGL frontend for Calzone");
|
||||
|
||||
Option fbdev("fb", "Framebuffer device e.g. /dev/fb0", STRING);
|
||||
|
||||
argParser.add_option(&fbdev);
|
||||
|
||||
ERROR argsErr = argParser.parse(argc, argv);
|
||||
if (argsErr == SPECIAL_CASE_HELP) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argsErr != NO_ERROR) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (fbdev.found()) {
|
||||
return lvgl_fb_run((const char*)fbdev.data);
|
||||
} else {
|
||||
return lvgl_fb_run("/dev/fb0");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user