Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import simple
import wrap
from generator import Options, GpioFlag
from panel import Panel, BacklightControl, CommandSequence, CompressionMode
from panel import Panel, BacklightControl, CommandSequence, CompressionMode, Mode


def generate_includes(p: Panel, options: Options) -> str:
Expand Down Expand Up @@ -158,6 +158,14 @@ def generate_commands(p: Panel, options: Options, cmd_name: str) -> str:
if c.wait and c.wait > options.ignore_wait:
s += f'\t{dsi_msleep(c.wait)};\n'


if cmd_name == 'on' and p.mode == Mode.CMD_MODE:
has_tear_on = any("set_tear_on" in c.generated for c in cmd.seq)
if not has_tear_on:
s += '''
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
'''

s += '''
return dsi_ctx.accum_err;
}
Expand Down