summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2022-03-21 14:20:05 -0500
committerJohn Klug <john.klug@multitech.com>2022-03-21 14:17:06 -0500
commitf873087849c21d0e3b203d7ced2dbf621af778a0 (patch)
tree26d9ae8afe7be96be142355f592362a03578dc36 /src
parent6c3ee5d6e3d2385f40752269740ca36f98407382 (diff)
downloadmts-io-sysfs-f873087849c21d0e3b203d7ced2dbf621af778a0.tar.gz
mts-io-sysfs-f873087849c21d0e3b203d7ced2dbf621af778a0.tar.bz2
mts-io-sysfs-f873087849c21d0e3b203d7ced2dbf621af778a0.zip
mtcap fpga loader bug fix0.2.4
Diffstat (limited to 'src')
-rw-r--r--src/AccessoryCards/Mtac15Fpga.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/AccessoryCards/Mtac15Fpga.cpp b/src/AccessoryCards/Mtac15Fpga.cpp
index fda3737..ed30fe3 100644
--- a/src/AccessoryCards/Mtac15Fpga.cpp
+++ b/src/AccessoryCards/Mtac15Fpga.cpp
@@ -684,7 +684,18 @@ Mtac15Fpga::Mtac15Fpga(std::string inputFile, std::string forcedPath) {
}
std::string hwVersion = deviceInfo["hardwareVersion"].GetString();
- if (deviceInfo.HasMember("accessoryCards") &&
+ if (hwVersion.find("MTCAP") != std::string::npos) {
+ hardwareType = HARDWARE_MTCAP;
+ port = "lora";
+ if (inputFile.empty()) {
+ input_file = MTCAP_DEFAULT_FILE;
+ } else {
+ input_file = inputFile;
+ }
+ spiPath = LORA_1_5_MTCAP_SPI;
+ getFpgaVersion();
+ spiPath = LORA_1_5_MTCAP_SPI_FPGA;
+ } else if (deviceInfo.HasMember("accessoryCards") &&
deviceInfo["accessoryCards"].IsArray() &&
deviceInfo["accessoryCards"].Size() > 0) {
rapidjson::SizeType acCardCount = deviceInfo["accessoryCards"].Size();
@@ -692,8 +703,6 @@ Mtac15Fpga::Mtac15Fpga(std::string inputFile, std::string forcedPath) {
hardwareType = HARDWARE_MTCDT3;
} else if (hwVersion.find("MTCDT") != std::string::npos) {
hardwareType = HARDWARE_MTCDT;
- } else if (hwVersion.find("MTCAP") != std::string::npos) {
- hardwareType = HARDWARE_MTCAP;
} else {
return;
}
@@ -749,15 +758,6 @@ Mtac15Fpga::Mtac15Fpga(std::string inputFile, std::string forcedPath) {
}
getFpgaVersion();
- } else if (hwVersion.find("MTCAP") != std::string::npos) {
- hardwareType = HARDWARE_MTCAP;
- if (inputFile.empty()) {
- input_file = MTCAP_DEFAULT_FILE;
- } else {
- input_file = inputFile;
- }
- spiPath = "/dev/spidev0.0";
- getFpgaVersion();
} else {
printError("No accessory cards installed/invalid hardware");
exitHandler(99);
@@ -845,6 +845,9 @@ int Mtac15Fpga::upgradeFpga() {
}
sleep(5);
printInfo("Reading New FPGA configuration");
+ if (hardwareType == HARDWARE_MTCAP) {
+ spiPath = LORA_1_5_MTCAP_SPI;
+ }
ret = getFpgaVersion();
if (ret != 0) {
return ret;