Skip to content

Commit

Permalink
Added display invert Web ui option
Browse files Browse the repository at this point in the history
  • Loading branch information
sle118 committed Feb 28, 2022
1 parent 828c287 commit 70e194e
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 613 deletions.
5 changes: 4 additions & 1 deletion components/platform_console/cmd_i2ctools.c
Expand Up @@ -100,6 +100,7 @@ static struct {
struct arg_int *back;
struct arg_int *reset;
struct arg_lit *clear;
struct arg_lit *invert;
struct arg_end *end;
} i2cdisp_args;

Expand Down Expand Up @@ -408,6 +409,7 @@ static int do_i2c_set_display(int argc, char **argv)
config.rotate = i2cdisp_args.rotate->count>0;
config.hflip = i2cdisp_args.hflip->count>0;
config.vflip = i2cdisp_args.vflip->count>0;
config.invert = i2cdisp_args.invert->count>0;

if(nerrors==0){
fprintf(f,"Saving display configuration\n");
Expand Down Expand Up @@ -961,7 +963,7 @@ cJSON * i2c_set_display_cb(){
cJSON_AddBoolToObject(values,"rotate",conf->rotate);
cJSON_AddBoolToObject(values,"hf",conf->hflip);
cJSON_AddBoolToObject(values,"vf",conf->vflip);

cJSON_AddBoolToObject(values,"invert",conf->invert);
}
return values;
}
Expand All @@ -982,6 +984,7 @@ static void register_i2c_set_display(){
i2cdisp_args.depth = arg_int0("p", "depth", "-1|1|4", "Bit Depth (only for SSD1326 displays)");
i2cdisp_args.type = arg_str0("t", "type", "<I2C|SPI>", "Interface (default I2C)");
i2cdisp_args.rotate = arg_lit0("r", "rotate", "Rotate 180 degrees");
i2cdisp_args.invert = arg_lit0("i", "invert", "Invert colors");
i2cdisp_args.clear = arg_lit0(NULL, "clear", "clear configuration and return");
i2cdisp_args.end = arg_end(8);
const esp_console_cmd_t i2c_set_display= {
Expand Down

0 comments on commit 70e194e

Please sign in to comment.