File tree Expand file tree Collapse file tree 5 files changed +21
-12
lines changed Expand file tree Collapse file tree 5 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,10 @@ oled-contrast = 143
232
232
display-order = default
233
233
osd-display-order = default
234
234
235
+ # OSD text columns. This is currently respected only when no LCD/OLED is found.
236
+ # Values: 16 <= N <= 40
237
+ osd-columns = 40
238
+
235
239
# Turn an LCD or OLED display off after N seconds of inactivity
236
240
# N=0: always off; N=255: always on
237
241
# Values: 0 <= N <= 255
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ struct packed ff_cfg {
165
165
uint8_t write_drain ;
166
166
uint8_t max_cyl ;
167
167
uint16_t osd_display_order ;
168
+ uint8_t osd_columns ;
168
169
};
169
170
170
171
extern struct ff_cfg ff_cfg ;
Original file line number Diff line number Diff line change @@ -577,11 +577,7 @@ bool_t lcd_init(void)
577
577
lcd_rows = 4 ;
578
578
} else {
579
579
lcd_columns = (ff_cfg .display_type >> _DISPLAY_lcd_columns ) & 63 ;
580
- lcd_columns = max_t (uint8_t , lcd_columns , 16 );
581
- lcd_columns = min_t (uint8_t , lcd_columns , 40 );
582
580
lcd_rows = (ff_cfg .display_type >> _DISPLAY_lcd_rows ) & 7 ;
583
- lcd_rows = max_t (uint8_t , lcd_rows , 2 );
584
- lcd_rows = min_t (uint8_t , lcd_rows , 4 );
585
581
}
586
582
587
583
if (a != 0 ) {
@@ -590,10 +586,14 @@ bool_t lcd_init(void)
590
586
i2c_addr = a ;
591
587
} else {
592
588
is_oled_display = FALSE;
593
- if (ff_cfg .display_type == DISPLAY_auto )
594
- lcd_columns = 40 ;
589
+ lcd_columns = ff_cfg .osd_columns ;
595
590
}
596
591
592
+ lcd_columns = max_t (uint8_t , lcd_columns , 16 );
593
+ lcd_columns = min_t (uint8_t , lcd_columns , 40 );
594
+ lcd_rows = max_t (uint8_t , lcd_rows , 2 );
595
+ lcd_rows = min_t (uint8_t , lcd_rows , 4 );
596
+
597
597
lcd_clear ();
598
598
599
599
}
Original file line number Diff line number Diff line change @@ -630,11 +630,7 @@ bool_t lcd_init(void)
630
630
lcd_rows = 4 ;
631
631
} else {
632
632
lcd_columns = (ff_cfg .display_type >> _DISPLAY_lcd_columns ) & 63 ;
633
- lcd_columns = max_t (uint8_t , lcd_columns , 16 );
634
- lcd_columns = min_t (uint8_t , lcd_columns , 40 );
635
633
lcd_rows = (ff_cfg .display_type >> _DISPLAY_lcd_rows ) & 7 ;
636
- lcd_rows = max_t (uint8_t , lcd_rows , 2 );
637
- lcd_rows = min_t (uint8_t , lcd_rows , 4 );
638
634
}
639
635
640
636
if (a != 0 ) {
@@ -643,10 +639,14 @@ bool_t lcd_init(void)
643
639
i2c_addr = a ;
644
640
} else {
645
641
is_oled_display = FALSE;
646
- if (ff_cfg .display_type == DISPLAY_auto )
647
- lcd_columns = 40 ;
642
+ lcd_columns = ff_cfg .osd_columns ;
648
643
}
649
644
645
+ lcd_columns = max_t (uint8_t , lcd_columns , 16 );
646
+ lcd_columns = min_t (uint8_t , lcd_columns , 40 );
647
+ lcd_rows = max_t (uint8_t , lcd_rows , 2 );
648
+ lcd_rows = min_t (uint8_t , lcd_rows , 4 );
649
+
650
650
lcd_clear ();
651
651
652
652
}
Original file line number Diff line number Diff line change @@ -1232,6 +1232,10 @@ static void read_ff_cfg(void)
1232
1232
ff_cfg .osd_display_order = parse_display_order (opts .arg );
1233
1233
break ;
1234
1234
1235
+ case FFCFG_osd_columns :
1236
+ ff_cfg .osd_columns = strtol (opts .arg , NULL , 10 );
1237
+ break ;
1238
+
1235
1239
case FFCFG_display_off_secs :
1236
1240
ff_cfg .display_off_secs = strtol (opts .arg , NULL , 10 );
1237
1241
cfg .ffcfg_has_display_off_secs = TRUE;
You can’t perform that action at this time.
0 commit comments