比如,输入是:[2, 1, [3, [4, 5], 6], 7, [8]] 则,输出是:[2, 1, 3, 4, 5, 6, 7, 8] def list_flatten(l, a=None): a = list(a) if isinstance(a, (list, tuple)) else [] for i in l: if isinstance(i, (list, tuple)): a = list_flatten(i, a) else: a.append(i) return a
qualcomm mdm9607的gpio12~gpio17定义如下: 现在如果想要设置GPIO_12~GPIO_17为普通GPIO口. 需要修改如下: 顺便附上qualcomm的说明: Remove qcom,tlmm-emmc-boot-select = <0x1>; along with other sdhc1 config in the device tree file "mdm9607-pinctrl.dtsi".