[FL-1506, FL-2197] Power, USB, LED driver improvements (#966)

* Power, USB, LED driver improvements
* u2f hid descriptor fix
* variable_item_list: value alignment fix
* InputTypeRepeat handling in menu/submenu/var_item_list
* lp5562: fix bugs on 400khz i2c
* Scripts: lint in parallel.
* FuriHal: rename some USB structure to match naming convention. Drivers: update magic values in LP5562.

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-01-21 19:55:44 +03:00
committed by GitHub
parent d4d87aa6a8
commit d4787e859e
35 changed files with 968 additions and 182 deletions

View File

@@ -4,6 +4,7 @@ import os
import re
import shutil
import subprocess
import multiprocessing
from flipper.app import App
@@ -60,16 +61,29 @@ class Main(App):
output.append(os.path.join(dirpath, filename))
return output
@staticmethod
def _format_source(task):
try:
subprocess.check_call(task)
return True
except subprocess.CalledProcessError as e:
return False
def _format_sources(self, sources: list, dry_run: bool = False):
args = ["clang-format", "--Werror", "--style=file", "-i"]
if dry_run:
args.append("--dry-run")
args += sources
try:
subprocess.check_call(args)
return True
except subprocess.CalledProcessError as e:
return False
files_per_task = 69
tasks = []
while len(sources) > 0:
tasks.append(args + sources[:files_per_task])
sources = sources[files_per_task:]
pool = multiprocessing.Pool()
results = pool.map(self._format_source, tasks)
return not False in results
def _fix_filename(self, filename: str):
return filename.replace("-", "_")