Version 1.18.2
Support new production DueX5 and DueX2 boards and Fan 8 Fix M21 Queue M42 commands Fix M106 incorrect P parameter check
This commit is contained in:
parent
a168bc307b
commit
7a05e499fc
10 changed files with 39 additions and 25 deletions
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 3 MiB |
Binary file not shown.
Binary file not shown.
|
@ -18,17 +18,20 @@ namespace DuetExpansion
|
||||||
|
|
||||||
const uint8_t DueXnAddress = 0x3E; // address of the SX1509B on the DueX0/DueX2/DueX5
|
const uint8_t DueXnAddress = 0x3E; // address of the SX1509B on the DueX0/DueX2/DueX5
|
||||||
|
|
||||||
const uint16_t BoardTypePins = (1u << 14) | (1u << 15);
|
// The original DueX2 and DueX5 boards had 2 board ID pins, bits 14 an 15.
|
||||||
|
// The new ones use bit 15 for fan 8, so not we just have bit 14.
|
||||||
|
// If we want any more variants, they will have to use a different I2C address.
|
||||||
|
const uint16_t BoardTypePins = (1u << 14);
|
||||||
const unsigned int BoardTypeShift = 14;
|
const unsigned int BoardTypeShift = 14;
|
||||||
const ExpansionBoardType boardTypes[] =
|
const ExpansionBoardType boardTypes[] = { ExpansionBoardType::DueX5, ExpansionBoardType::DueX2 };
|
||||||
{ ExpansionBoardType::DueX5, ExpansionBoardType::DueX2, ExpansionBoardType::DueX0, ExpansionBoardType::none };
|
|
||||||
|
|
||||||
const unsigned int Fan3Bit = 12;
|
const unsigned int Fan3Bit = 12;
|
||||||
const unsigned int Fan4Bit = 7;
|
const unsigned int Fan4Bit = 7;
|
||||||
const unsigned int Fan5Bit = 6;
|
const unsigned int Fan5Bit = 6;
|
||||||
const unsigned int Fan6Bit = 5;
|
const unsigned int Fan6Bit = 5;
|
||||||
const unsigned int Fan7Bit = 4;
|
const unsigned int Fan7Bit = 4;
|
||||||
const uint16_t AllFanBits = (1u << Fan3Bit) | (1u << Fan4Bit) | (1u << Fan5Bit) | (1u << Fan6Bit) | (1u << Fan7Bit);
|
const unsigned int Fan8Bit = 15;
|
||||||
|
const uint16_t AllFanBits = (1u << Fan3Bit) | (1u << Fan4Bit) | (1u << Fan5Bit) | (1u << Fan6Bit) | (1u << Fan7Bit) | (1 << Fan8Bit);
|
||||||
|
|
||||||
const unsigned int E2StopBit = 0;
|
const unsigned int E2StopBit = 0;
|
||||||
const unsigned int E3StopBit = 3;
|
const unsigned int E3StopBit = 3;
|
||||||
|
|
|
@ -114,8 +114,8 @@ const Pin VssaSensePin = 103;
|
||||||
const Pin Z_PROBE_MOD_PIN = 34; // Digital pin number to turn the IR LED on (high) or off (low) on Duet v0.6 and v1.0 (PB21)
|
const Pin Z_PROBE_MOD_PIN = 34; // Digital pin number to turn the IR LED on (high) or off (low) on Duet v0.6 and v1.0 (PB21)
|
||||||
|
|
||||||
// COOLING FANS
|
// COOLING FANS
|
||||||
const size_t NUM_FANS = 8;
|
const size_t NUM_FANS = 9;
|
||||||
const Pin COOLING_FAN_PINS[NUM_FANS] = { 55, 58, 00, 212, 207, 206, 205, 204 };
|
const Pin COOLING_FAN_PINS[NUM_FANS] = { 55, 58, 00, 212, 207, 206, 205, 204, 215 };
|
||||||
const Pin COOLING_FAN_RPM_PIN = 102; // PB6 on expansion connector
|
const Pin COOLING_FAN_RPM_PIN = 102; // PB6 on expansion connector
|
||||||
|
|
||||||
// SD cards
|
// SD cards
|
||||||
|
|
|
@ -48,27 +48,37 @@ bool GCodeQueue::QueueCode(GCodeBuffer &gb, uint32_t segmentsLeft)
|
||||||
|
|
||||||
// Set active/standby temperatures
|
// Set active/standby temperatures
|
||||||
queueCode = (code == 10 && gb.Seen('P'));
|
queueCode = (code == 10 && gb.Seen('P'));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 'M':
|
case 'M':
|
||||||
{
|
{
|
||||||
const int code = gb.GetIValue();
|
const int code = gb.GetIValue();
|
||||||
|
switch(code)
|
||||||
|
{
|
||||||
|
case 3: // spindle control
|
||||||
|
case 4:
|
||||||
|
case 5:
|
||||||
|
case 42: // set IO pin
|
||||||
|
case 106: // fan control
|
||||||
|
case 107:
|
||||||
|
case 104: // set temperatures and return immediately
|
||||||
|
case 140:
|
||||||
|
case 141:
|
||||||
|
case 144:
|
||||||
|
case 117: // display message
|
||||||
|
case 280: // set servo
|
||||||
|
case 300: // beep
|
||||||
|
case 420: // set RGB colour
|
||||||
|
queueCode = true;
|
||||||
|
break;
|
||||||
|
|
||||||
// Fan control
|
default:
|
||||||
queueCode |= (code == 106 || code == 107);
|
|
||||||
|
|
||||||
// Set temperatures and return immediately
|
|
||||||
queueCode |= (code == 104 || code == 140 || code == 141 || code == 144);
|
|
||||||
|
|
||||||
// Display Message (LCD), Beep, RGB colour, Set servo position
|
|
||||||
queueCode |= (code == 117 || code == 300 || code == 280 || code == 420);
|
|
||||||
|
|
||||||
// Valve control
|
|
||||||
queueCode |= (code == 126 || code == 127);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Does it make sense to queue this code?
|
// Does it make sense to queue this code?
|
||||||
if (queueCode)
|
if (queueCode)
|
||||||
|
|
|
@ -958,9 +958,9 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, StringRef& reply)
|
||||||
bool seenFanNum = false;
|
bool seenFanNum = false;
|
||||||
int32_t fanNum = 0; // Default to the first fan
|
int32_t fanNum = 0; // Default to the first fan
|
||||||
gb.TryGetIValue('P', fanNum, seenFanNum);
|
gb.TryGetIValue('P', fanNum, seenFanNum);
|
||||||
if (fanNum < 0 || fanNum > (int)NUM_FANS)
|
if (fanNum < 0 || fanNum >= (int)NUM_FANS)
|
||||||
{
|
{
|
||||||
reply.printf("Fan number %d is invalid, must be between 0 and %u", fanNum, NUM_FANS);
|
reply.printf("Fan number %d is invalid, must be between 0 and %u", fanNum, NUM_FANS - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -366,6 +366,7 @@ bool MassStorage::Mount(size_t card, StringRef& reply, bool reportSuccess)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Mount the file systems
|
// Mount the file systems
|
||||||
|
memset(&fileSystems[card], 0, sizeof(FATFS)); // f_mount doesn't initialise the file structure, we must do it ourselves
|
||||||
FRESULT mounted = f_mount(card, &fileSystems[card]);
|
FRESULT mounted = f_mount(card, &fileSystems[card]);
|
||||||
if (mounted != FR_OK)
|
if (mounted != FR_OK)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
#define SRC_VERSION_H_
|
#define SRC_VERSION_H_
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VERSION
|
||||||
# define VERSION "1.18.1"
|
# define VERSION "1.18.2"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DATE
|
#ifndef DATE
|
||||||
# define DATE "2017-04-09"
|
# define DATE "2017-06-16"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman"
|
#define AUTHORS "reprappro, dc42, chrishamm, t3p3, dnewman"
|
||||||
|
|
Reference in a new issue