Skip to content

Commit

Permalink
Merge pull request #136 from blackboxembedded/work_20240526
Browse files Browse the repository at this point in the history
Minor work
  • Loading branch information
blackboxembedded authored May 26, 2024
2 parents 5f91b75 + 10b41d0 commit 7d4af57
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 31 deletions.
4 changes: 2 additions & 2 deletions WunderLINQ.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.19;
MARKETING_VERSION = 2.0.20;
PRODUCT_BUNDLE_IDENTIFIER = com.blackboxembedded.wunderlinq;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -1111,7 +1111,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.19;
MARKETING_VERSION = 2.0.20;
PRODUCT_BUNDLE_IDENTIFIER = com.blackboxembedded.wunderlinq;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
5 changes: 1 addition & 4 deletions WunderLINQ/MainCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1870,8 +1870,7 @@ class MainCollectionViewController: UIViewController, UICollectionViewDataSource
let dataLength = data.count / MemoryLayout<UInt8>.size
var dataArray = [UInt8](repeating: 0, count: dataLength)
(data as NSData).getBytes(&dataArray, length: dataLength * MemoryLayout<Int16>.size)

/*

var messageHexString = ""
for i in 0 ..< dataLength {
messageHexString += String(format: "%02X", dataArray[i])
Expand All @@ -1880,7 +1879,6 @@ class MainCollectionViewController: UIViewController, UICollectionViewDataSource
}
}
NSLog("MainCollectionViewController: Command Response Received: \(messageHexString)")
*/

switch (dataArray[0]){
case 0x57:
Expand All @@ -1891,7 +1889,6 @@ class MainCollectionViewController: UIViewController, UICollectionViewDataSource
NSLog("MainCollectionViewController: Received WRS command response")
if (wlqData != nil){
WLQ.shared.setStatus(bytes: dataArray)
//NSLog("MainCollectionViewController: Command Response Received: \(messageHexString)")
notificationCenter.post(name: Notification.Name("StatusUpdate"), object: nil)
launchAccPage()
}
Expand Down
2 changes: 1 addition & 1 deletion WunderLINQ/MusicViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class MusicViewController: UIViewController, SPTAppRemotePlayerStateDelegate {
switch (musicApp){
case 0: // Apple Music
if appleMusicTrackElapsed != nil {
if Int(appleMusicTrackElapsed) < 3 {
if appleMusicTrackElapsed < 3.0 {
appleMusicPlayer.skipToPreviousItem()
} else {
appleMusicPlayer.skipToBeginning()
Expand Down
17 changes: 5 additions & 12 deletions WunderLINQ/hardware/WLQ/WLQ_C.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class WLQ_C: WLQ {

self.flashConfig = Array(bytes[6..<(6+configFlashSize)])
self.tempConfig = self.flashConfig
/*

var messageHexString = ""
for i in 0 ..< flashConfig!.count {
messageHexString += String(format: "%02X", flashConfig![i])
Expand All @@ -334,15 +334,7 @@ class WLQ_C: WLQ {
}
}
NSLog("WLQ_C: flashConfig: \(messageHexString)")
var tmessageHexString = ""
for i in 0 ..< tempConfig!.count {
tmessageHexString += String(format: "%02X", tempConfig![i])
if i < tempConfig!.count - 1 {
tmessageHexString += ","
}
}
NSLog("WLQ_C: tempConfig: \(tmessageHexString)")
*/

self.keyMode = bytes[self.keyMode_INDEX]

self.wheelRightPressKeyType = self.flashConfig![self.wheelRightPressKeyType_INDEX]
Expand Down Expand Up @@ -958,9 +950,9 @@ class WLQ_C: WLQ {
}
return modifiers
}

//Old

override func setfirmwareVersion(firmwareVersion: String?){
NSLog("WLQ_C: Firmware Version: \(firmwareVersion ?? "?")")
self.firmwareVersion = firmwareVersion
}
override func getfirmwareVersion() -> String{
Expand All @@ -971,6 +963,7 @@ class WLQ_C: WLQ {
}

override func sethardwareVersion(hardwareVersion: String?){
NSLog("WLQ_C: HW Version: \(hardwareVersion ?? "?")")
self.hardwareVersion = hardwareVersion
}
override func gethardwareVersion() -> String{
Expand Down
17 changes: 5 additions & 12 deletions WunderLINQ/hardware/WLQ/WLQ_N.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class WLQ_N: WLQ {
if (self.firmwareVersion!.toDouble()! >= 2.0) { // FW >=2.0
self.flashConfig = Array(bytes[26..<(26+configFlashSize)])
self.tempConfig = self.flashConfig
/*

var messageHexString = ""
for i in 0 ..< flashConfig!.count {
messageHexString += String(format: "%02X", flashConfig![i])
Expand All @@ -279,15 +279,7 @@ class WLQ_N: WLQ {
}
}
NSLog("WLQ_N: flashConfig: \(messageHexString)")
var tmessageHexString = ""
for i in 0 ..< tempConfig!.count {
tmessageHexString += String(format: "%02X", tempConfig![i])
if i < tempConfig!.count - 1 {
tmessageHexString += ","
}
}
NSLog("WLQ_N: tempConfig: \(tmessageHexString)")
*/

self.keyMode = bytes[self.keyMode_INDEX]
let usbBytes: [UInt8] = [self.flashConfig![self.USBVinThresholdHigh_INDEX], self.flashConfig![self.USBVinThresholdLow_INDEX]]
self.USBVinThreshold = usbBytes.withUnsafeBytes { $0.load(as: UInt16.self) }
Expand Down Expand Up @@ -1085,9 +1077,9 @@ class WLQ_N: WLQ {
}
return modifiers
}

//Old

override func setfirmwareVersion(firmwareVersion: String?){
NSLog("WLQ_N: Firmware Version: \(firmwareVersion ?? "?")")
self.firmwareVersion = firmwareVersion
}
override func getfirmwareVersion() -> String{
Expand All @@ -1098,6 +1090,7 @@ class WLQ_N: WLQ {
}

override func sethardwareVersion(hardwareVersion: String?){
NSLog("WLQ_N: HW Version: \(hardwareVersion ?? "?")")
self.hardwareVersion = hardwareVersion
}
override func gethardwareVersion() -> String{
Expand Down

0 comments on commit 7d4af57

Please sign in to comment.