Tab5 camera + other stuff (#558)
* Tab5 camera + other stuff Tab5 camera driver - SC2356 Custom SliderBox widget - slider with plus and minus buttons + value label and snapping Rtc Time service + rtc api Sdk release - only include drivers built for that specific target, eg: sc2356 driver is mipi / p4 only. No more hardcoded manual sdk cmakelists New function to find device by compatible string match. no more static cast bool wildness when trying to match a single device (like M5Stack PaperS3 for example) * feedback + fixes Fixed external app user data path. fix(gui): block app teardown until onHide() completes, preventing ELF unload racing a still-running app added camera device type and api * drain the snake sssem --------- Co-authored-by: Ken Van Hoeylandt <git@kenvanhoeylandt.net>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
namespace tt::lvgl {
|
||||
|
||||
/**
|
||||
* Create a SliderBox: a slider flanked by "-" and "+" buttons with a value label.
|
||||
* @param parent the parent object
|
||||
* @param min minimum value (inclusive)
|
||||
* @param max maximum value (inclusive)
|
||||
* @param step the amount each +/- button press changes the value by
|
||||
* @param value the initial value
|
||||
* @return the created SliderBox instance
|
||||
*/
|
||||
lv_obj_t* sliderbox_create(lv_obj_t* parent, int32_t min, int32_t max, int32_t step, int32_t value);
|
||||
|
||||
/** @return the current value of the SliderBox */
|
||||
int32_t sliderbox_get_value(lv_obj_t* obj);
|
||||
|
||||
/**
|
||||
* Set the current value of the SliderBox (clamped to its [min, max] range).
|
||||
* Updates the slider position and the value label.
|
||||
*/
|
||||
void sliderbox_set_value(lv_obj_t* obj, int32_t value, lv_anim_enable_t anim);
|
||||
|
||||
/**
|
||||
* Register a callback that is fired with LV_EVENT_VALUE_CHANGED whenever the value
|
||||
* changes, whether the change came from the slider or from the +/- buttons.
|
||||
* @param obj the SliderBox instance
|
||||
* @param callback the callback to invoke
|
||||
* @param userData user data that is attached to the event
|
||||
*/
|
||||
void sliderbox_add_value_changed_cb(lv_obj_t* obj, lv_event_cb_t callback, void* userData);
|
||||
|
||||
} // namespace tt::lvgl
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
namespace tt::service::rtctime {
|
||||
|
||||
/** @return true when an RTC_TYPE device is bound and ready */
|
||||
bool isAvailable();
|
||||
|
||||
} // namespace tt::service::rtctime
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/kernel/SystemEvents.h>
|
||||
#include <Tactility/service/Service.h>
|
||||
#include <Tactility/service/ServiceContext.h>
|
||||
#include <Tactility/service/rtctime/RtcTime.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
struct Device;
|
||||
|
||||
namespace tt::service::rtctime {
|
||||
|
||||
class RtcTimeService final : public Service {
|
||||
|
||||
kernel::SystemEventSubscription timeEventSubscription = 0;
|
||||
Device* rtcDevice = nullptr;
|
||||
|
||||
Device* findRtcDevice();
|
||||
void onTimeChanged(kernel::SystemEvent event);
|
||||
|
||||
public:
|
||||
|
||||
bool onStart(ServiceContext& serviceContext) override;
|
||||
void onStop(ServiceContext& serviceContext) override;
|
||||
|
||||
bool isAvailable() const;
|
||||
};
|
||||
|
||||
std::shared_ptr<RtcTimeService> findRtcTimeService();
|
||||
|
||||
} // namespace tt::service::rtctime
|
||||
Reference in New Issue
Block a user