@@ -310,21 +310,27 @@ def generate_layout_dir(ecdir: str, board: str, is_qmk: bool) -> None:
310
310
f"{ ecdir } /keyboards/{ board } /{ board .split ('/' )[- 1 ]} .c" ).read ()
311
311
else :
312
312
with open (f"{ ecdir } /src/board/{ board } /board.mk" ) as f :
313
- m = re .search ('^KBLED=(.*)$' , f .read (), re .MULTILINE )
314
- assert m is not None
315
- kbled = m .group (1 )
316
- if kbled == 'white_dac' :
317
- has_color = False
318
- # bonw14: Handled through USB. Can configurator support this?
319
- elif kbled in ['none' , 'bonw14' ]:
320
- has_brightness = False
321
- has_color = False
322
- elif kbled not in ['rgb_pwm' , 'oryp5' , 'darp5' ]:
323
- raise Exception (f"KBLED='{ kbled } ' not handled by layouts.py" )
313
+ board_mk = f .read ()
314
+
315
+ m = re .search ('^KEYBOARD=(.*)$' , board_mk , re .MULTILINE )
316
+ assert m is not None
317
+ keyboard = board .rsplit ('/' , 1 )[0 ] + '/' + m .group (1 )
318
+
319
+ m = re .search ('^KBLED=(.*)$' , board_mk , re .MULTILINE )
320
+ assert m is not None
321
+ kbled = m .group (1 )
322
+ if kbled == 'white_dac' :
323
+ has_color = False
324
+ # bonw14: Handled through USB. Can configurator support this?
325
+ elif kbled in ['none' , 'bonw14' ]:
326
+ has_brightness = False
327
+ has_color = False
328
+ elif kbled not in ['rgb_pwm' , 'oryp5' , 'darp5' ]:
329
+ raise Exception (f"KBLED='{ kbled } ' not handled by layouts.py" )
324
330
325
331
keymap_h = open (
326
- f"{ ecdir } /src/board/ { board } /include/board/keymap.h" ).read ()
327
- default_c = open (f"{ ecdir } /src/board/ { board } /keymap/default.c" ).read ()
332
+ f"{ ecdir } /src/keyboard/ { keyboard } /include/board/keymap.h" ).read ()
333
+ default_c = open (f"{ ecdir } /src/keyboard/ { keyboard } /keymap/default.c" ).read ()
328
334
led_c = ""
329
335
330
336
os .makedirs (f'{ layoutdir } ' , exist_ok = True )
0 commit comments