Add drivers to module and make start/stop optional (#580)
This commit is contained in:
committed by
GitHub
parent
08eac48e64
commit
429125734a
@@ -7,7 +7,7 @@ constexpr auto* TAG = "StickCPlus2";
|
||||
|
||||
extern "C" {
|
||||
|
||||
static bool init_power() {
|
||||
static error_t init_power() {
|
||||
// CH552 applies 4 V to GPIO 0, which reduces Wi-Fi sensitivity.
|
||||
// Setting output to high adds a bias of 3.3 V and suppresses over-voltage:
|
||||
gpio_set_direction(GPIO_NUM_0, GPIO_MODE_OUTPUT);
|
||||
@@ -17,25 +17,12 @@ static bool init_power() {
|
||||
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(GPIO_NUM_4, 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static error_t start() {
|
||||
init_power();
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
Module m5stack_stickc_plus2_module = {
|
||||
.name = "m5stack-stickc-plus2",
|
||||
.start = start,
|
||||
.stop = stop,
|
||||
.symbols = nullptr,
|
||||
.internal = nullptr
|
||||
.start = init_power
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user