forked from Duet3D/RepRapFirmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporary fix for RTD temperature spikes causing failed prints Added 'only if printing a file' condition in M581 command Fixed M117 for PanelDue Don't print extruder positions in M114 because they are always zero Process M0 and M1 when in simulation mode Allow setting of fan PWM from 50% upwards when a fan is in thermostatic mode Reduced default extruder heater PWM frequency Axes are no longer homes when microstepping is changed SD card interface speed is included in M122 output
- Loading branch information
Showing
24 changed files
with
4,266 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* FirmwareUpdater.cpp | ||
* | ||
* Created on: 21 May 2016 | ||
* Author: David | ||
*/ | ||
|
||
#include "FirmwareUpdater.h" | ||
#include "RepRapFirmware.h" | ||
#include "WifiFirmwareUploader.h" | ||
|
||
namespace FirmwareUpdater | ||
{ | ||
const unsigned int WifiFirmwareModule = 1; | ||
const unsigned int WifiFilesModule = 2; | ||
const unsigned int WifiExternalFirmwareModule = 3; | ||
|
||
// Check that the prerequisites are satisfied. | ||
// Return true if yes, else print a message and return false. | ||
bool CheckFirmwareUpdatePrerequisites(uint8_t moduleMap) | ||
{ | ||
if ((moduleMap & (1 << WifiExternalFirmwareModule)) != 0 && (moduleMap & ((1 << WifiFirmwareModule) | (1 << WifiFilesModule))) != 0) | ||
{ | ||
reprap.GetPlatform()->Message(GENERIC_MESSAGE, "Invalid combination of firmware update modules\n"); | ||
return false; | ||
} | ||
if ((moduleMap & (1 << WifiFirmwareModule)) != 0 && !reprap.GetPlatform()->GetMassStorage()->FileExists(SYS_DIR, WIFI_FIRMWARE_FILE)) | ||
{ | ||
reprap.GetPlatform()->MessageF(GENERIC_MESSAGE, "File %s not found\n", WIFI_FIRMWARE_FILE); | ||
return false; | ||
} | ||
if ((moduleMap & (1 << WifiFilesModule)) != 0 && !reprap.GetPlatform()->GetMassStorage()->FileExists(SYS_DIR, WIFI_WEB_FILE)) | ||
{ | ||
reprap.GetPlatform()->MessageF(GENERIC_MESSAGE, "File %s not found\n", WIFI_WEB_FILE); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
bool IsReady() | ||
{ | ||
return reprap.GetNetwork()->GetWifiUploader()->IsReady(); | ||
} | ||
|
||
void UpdateModule(unsigned int module) | ||
{ | ||
switch(module) | ||
{ | ||
case WifiExternalFirmwareModule: | ||
Network::ResetWiFiForExternalUpload(); | ||
break; | ||
|
||
case WifiFirmwareModule: | ||
reprap.GetNetwork()->GetWifiUploader()->SendUpdateFile(WIFI_FIRMWARE_FILE, SYS_DIR, WifiFirmwareUploader::FirmwareAddress); | ||
break; | ||
|
||
case WifiFilesModule: | ||
reprap.GetNetwork()->GetWifiUploader()->SendUpdateFile(WIFI_WEB_FILE, SYS_DIR, WifiFirmwareUploader::WebFilesAddress); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
// End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* FirmwareUpdater.h | ||
* | ||
* Created on: 21 May 2016 | ||
* Author: David | ||
*/ | ||
|
||
#ifndef SRC_DUETNG_FIRMWAREUPDATER_H_ | ||
#define SRC_DUETNG_FIRMWAREUPDATER_H_ | ||
|
||
#include <cstdint> | ||
|
||
namespace FirmwareUpdater | ||
{ | ||
bool CheckFirmwareUpdatePrerequisites(uint8_t moduleMap); | ||
bool IsReady(); | ||
void UpdateModule(unsigned int module); | ||
} | ||
|
||
#endif /* SRC_DUETNG_FIRMWAREUPDATER_H_ */ |
Oops, something went wrong.