mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-31 13:22:31 +01:00 
			
		
		
		
	Skip parsing g_led_config when matrix_size is missing (#24739)
This commit is contained in:
		
							parent
							
								
									5593e73ba7
								
							
						
					
					
						commit
						f549948bbd
					
				| @ -773,23 +773,24 @@ def find_keyboard_c(keyboard): | |||||||
| def _extract_led_config(info_data, keyboard): | def _extract_led_config(info_data, keyboard): | ||||||
|     """Scan all <keyboard>.c files for led config |     """Scan all <keyboard>.c files for led config | ||||||
|     """ |     """ | ||||||
|     cols = info_data['matrix_size']['cols'] |  | ||||||
|     rows = info_data['matrix_size']['rows'] |  | ||||||
| 
 |  | ||||||
|     for feature in ['rgb_matrix', 'led_matrix']: |     for feature in ['rgb_matrix', 'led_matrix']: | ||||||
|         if info_data.get('features', {}).get(feature, False) or feature in info_data: |         if info_data.get('features', {}).get(feature, False) or feature in info_data: | ||||||
| 
 |  | ||||||
|             # Only attempt search if dd led config is missing |             # Only attempt search if dd led config is missing | ||||||
|             if 'layout' not in info_data.get(feature, {}): |             if 'layout' not in info_data.get(feature, {}): | ||||||
|                 # Process |                 cols = info_data.get('matrix_size', {}).get('cols') | ||||||
|                 for file in find_keyboard_c(keyboard): |                 rows = info_data.get('matrix_size', {}).get('rows') | ||||||
|                     try: |                 if cols and rows: | ||||||
|                         ret = find_led_config(file, cols, rows) |                     # Process | ||||||
|                         if ret: |                     for file in find_keyboard_c(keyboard): | ||||||
|                             info_data[feature] = info_data.get(feature, {}) |                         try: | ||||||
|                             info_data[feature]['layout'] = ret |                             ret = find_led_config(file, cols, rows) | ||||||
|                     except Exception as e: |                             if ret: | ||||||
|                         _log_warning(info_data, f'led_config: {file.name}: {e}') |                                 info_data[feature] = info_data.get(feature, {}) | ||||||
|  |                                 info_data[feature]['layout'] = ret | ||||||
|  |                         except Exception as e: | ||||||
|  |                             _log_warning(info_data, f'led_config: {file.name}: {e}') | ||||||
|  |                     else: | ||||||
|  |                         _log_warning(info_data, 'led_config: matrix size required to parse g_led_config') | ||||||
| 
 | 
 | ||||||
|             if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None): |             if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None): | ||||||
|                 info_data[feature]['led_count'] = len(info_data[feature]['layout']) |                 info_data[feature]['led_count'] = len(info_data[feature]['layout']) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Joel Challis
						Joel Challis