mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-13 06:16:16 +00:00
fix: lite breaks layout viewer
This commit is contained in:
@@ -61,8 +61,7 @@ export async function initSerial(manual = false) {
|
||||
|
||||
const parsedLayout: CharaLayout = [[], [], []]
|
||||
for (let layer = 1; layer <= 3; layer++) {
|
||||
// TODO: this will fail for LITE!
|
||||
for (let i = 0; i < 90; i++) {
|
||||
for (let i = 0; i < device.keyCount; i++) {
|
||||
parsedLayout[layer - 1][i] = await device.getLayoutKey(layer, i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export class CharaDevice {
|
||||
company!: "CHARACHORDER"
|
||||
device!: "ONE" | "LITE"
|
||||
chipset!: "M0" | "S2"
|
||||
keyCount!: 90 | 67
|
||||
|
||||
constructor(private readonly baudRate = 115200) {}
|
||||
|
||||
@@ -62,6 +63,7 @@ export class CharaDevice {
|
||||
this.company = company as "CHARACHORDER"
|
||||
this.device = device as "ONE" | "LITE"
|
||||
this.chipset = chipset as "M0" | "S2"
|
||||
this.keyCount = this.device === "ONE" ? 90 : 67
|
||||
}
|
||||
|
||||
private async suspend() {
|
||||
|
||||
Reference in New Issue
Block a user