File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -124,14 +124,20 @@ def generate_reset(p: Panel) -> str:
124124
125125
126126def generate_commands (p : Panel , options : Options , cmd_name : str ) -> str :
127+ cmd = p .cmds [cmd_name ]
128+
127129 s = f'''\
128130 static int { p .short_id } _{ cmd_name } (struct { p .short_id } *ctx)
129131{{
130- struct mipi_dsi_device *dsi = ctx->dsi;
131- struct device *dev = &dsi->dev;
132- int ret;
133132'''
134- cmd = p .cmds [cmd_name ]
133+ variables = ['struct mipi_dsi_device *dsi = ctx->dsi' ]
134+ if '(dev, ' in cmd .generated :
135+ variables .append ('struct device *dev = &dsi->dev' )
136+ if 'ret = ' in cmd .generated :
137+ variables .append ('int ret' )
138+
139+ for v in variables :
140+ s += f'\t { v } ;\n '
135141
136142 if p .cmds ['on' ].state != p .cmds ['off' ].state :
137143 if cmd .state == CommandSequence .State .LP_MODE :
You can’t perform that action at this time.
0 commit comments