Skip to content

Commit 3277af2

Browse files
committed
mipi: Handle weird NULL_PACKET
This seems to be just a dummy packet, in this case used to insert a delay. The delay will still be generated, but we don't actually send any packet to the panel. I doubt this is really necessary.
1 parent afef38b commit 3277af2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ def generate_commands(p: Panel, options: Options, cmd_name: str) -> str:
147147

148148
block = True
149149
for c in cmd.seq:
150-
if block or '{' in c.generated:
150+
if block or '{' in c.generated or '//' in c.generated:
151151
s += '\n'
152-
block = '{' in c.generated
152+
block = '{' in c.generated or '//' in c.generated
153153

154154
s += c.generated + '\n'
155155
if c.wait and c.wait > options.ignore_wait:

mipi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ def _generate_peripheral(t: Transaction, payload: bytes, options: Options) -> st
209209
raise ValueError(t)
210210

211211

212+
def _generate_null_packet(t: Transaction, payload: bytes, options: Options) -> str:
213+
return "\t// WARNING: Ignoring weird NULL_PACKET (dummy packet)"
214+
215+
212216
def _generate_fallback(t: Transaction, payload: bytes, options: Options) -> str:
213217
raise ValueError(t.name + ' is not supported')
214218

@@ -246,7 +250,7 @@ class Transaction(Enum):
246250

247251
END_OF_TRANSMISSION = 0x08,
248252

249-
NULL_PACKET = 0x09,
253+
NULL_PACKET = 0x09, -1, _generate_null_packet
250254
BLANKING_PACKET = 0x19,
251255
GENERIC_LONG_WRITE = 0x29, -1, _generate_generic_write
252256
DCS_LONG_WRITE = 0x39, -1, _generate_dcs_write

0 commit comments

Comments
 (0)