Compare commits

...

3 Commits

Author SHA1 Message Date
Jack M. 2ca22bc0c4
Merge 7b023a3e8e into 63b3ef0151 2025-02-13 00:31:49 +09:00
Andrew Nicholson 63b3ef0151
Enable "Boot Interface Subclass" for keyboard and mouse. (#113)
This is often required for the keyboard/mouse to be recognized in
BIOS/UEFI firmware.
2025-02-12 15:08:03 +01:00
Jack M. 7b023a3e8e
fix: NTP requests sleep for 1 hour between attempts.
Fixes #74 - When the device is unable to connect to the time servers, it
was looping every two seconds.  This lead to unecessary processing, and
if the device was able to connect to DNS but not the time servers, it
was causing undue load on the DNS server as well.
2025-01-25 06:42:39 -07:00
2 changed files with 4 additions and 2 deletions

2
ntp.go
View File

@ -20,6 +20,8 @@ func TimeSyncLoop() {
err := SyncSystemTime() err := SyncSystemTime()
if err != nil { if err != nil {
log.Printf("Failed to sync system time: %v", err) log.Printf("Failed to sync system time: %v", err)
// Sync failed for all 4 endpoints, likely network issue, wait for 1 hour before retrying
time.Sleep(1 * time.Hour)
continue continue
} }
log.Printf("Time sync successful, now is: %v, time taken: %v", time.Now(), time.Since(start)) log.Printf("Time sync successful, now is: %v, time taken: %v", time.Now(), time.Since(start))

4
usb.go
View File

@ -132,7 +132,7 @@ func writeGadgetConfig() error {
} }
err = writeGadgetAttrs(hid0Path, [][]string{ err = writeGadgetAttrs(hid0Path, [][]string{
{"protocol", "1"}, {"protocol", "1"},
{"subclass", "0"}, {"subclass", "1"},
{"report_length", "8"}, {"report_length", "8"},
}) })
if err != nil { if err != nil {
@ -152,7 +152,7 @@ func writeGadgetConfig() error {
} }
err = writeGadgetAttrs(hid1Path, [][]string{ err = writeGadgetAttrs(hid1Path, [][]string{
{"protocol", "2"}, {"protocol", "2"},
{"subclass", "0"}, {"subclass", "1"},
{"report_length", "6"}, {"report_length", "6"},
}) })
if err != nil { if err != nil {