General fixes for LPC1768 (#7834)
* fixed some include paths * LPC1768: Fix Serial API Add missing serial methods used if TX_BUFFER_SIZE is set Change return value of HalSerial:read to match Arduino API * LPC1768: add filters to ADC This is to try and compensate for hardware issue and oversensitivity to noise * LPC1768: remove the polling section of delayMicroseconds * LPC1768: lock usb mass storage device while device accesses it. Currently only applicable to persistent store, The device always has priority and will unmount the sd card from the host, Windows then tries to automount again so it can look like the explorer window freezes. Linux Mint, by default, just closes the Nemo window. * Add timeout to make sure if Serial never connects that Marlin still boots * Remove unneeded ifdef CPU_32_BIT In general the need for ifdef CPU_32_BIT blocks means that something is missing from the HAL API or a Platform, in this case HAL_TICKS_PER_US was missing from the AVR Platform * LPC1768: relocate RE-ARM debug_extra_script.py
This commit is contained in:
committed by
Scott Lahteine
parent
7258218f89
commit
46b2773e13
@ -38,7 +38,7 @@ extern void MSC_SetCSW (void);
|
||||
extern void MSC_BulkIn (void);
|
||||
extern void MSC_BulkOut(void);
|
||||
|
||||
enum class Sense_KEY : uint8_t {
|
||||
enum struct Sense_KEY : uint8_t {
|
||||
NO_SENSE,
|
||||
RECOVERED_ERROR,
|
||||
NOT_READY,
|
||||
@ -49,15 +49,25 @@ enum class Sense_KEY : uint8_t {
|
||||
DATA_PROTECT
|
||||
};
|
||||
|
||||
enum class Sense_ASC : uint8_t {
|
||||
enum struct Sense_ASC : uint8_t {
|
||||
NONE = 0x0,
|
||||
LOGICAL_UNIT_NOT_READY = 0x04,
|
||||
CANNOT_READ_MEDIUM = 0x30,
|
||||
MEDIUM_NOT_PRESENT = 0x3A
|
||||
MEDIUM_NOT_PRESENT = 0x3A,
|
||||
MEDIA_CHANGED = 0x28
|
||||
};
|
||||
|
||||
enum class Sense_ASCQ : uint8_t {
|
||||
// CANNOT_READ_MEDIUM
|
||||
enum struct Sense_ASCQ : uint8_t {
|
||||
// ASC: LOGICAL_UNIT_NOT_READY
|
||||
CAUSE_NOT_REPORTABLE = 0x00,
|
||||
UNIT_IS_IN_PROCESS_OF_BECOMING_READY,
|
||||
INITIALIZING_COMMAND_REQUIRED,
|
||||
MANUAL_INTERVENTION_REQUIRED,
|
||||
FORMAT_IN_PROGRESS,
|
||||
DEVICE_IS_BUSY = 0xFF,
|
||||
// ASC: CANNOT_READ_MEDIUM
|
||||
UNKNOWN_FORMAT = 0x01,
|
||||
// MEDIUM_NOT_PRESENT
|
||||
// ASC: MEDIUM_NOT_PRESENT
|
||||
REASON_UNKNOWN = 0x00,
|
||||
TRAY_CLOSED,
|
||||
TRAY_OPEN,
|
||||
@ -65,5 +75,30 @@ enum class Sense_ASCQ : uint8_t {
|
||||
AUXILIARY_MEMORY_ACCESSIBLE
|
||||
};
|
||||
|
||||
struct Sense {
|
||||
Sense() {
|
||||
reset();
|
||||
}
|
||||
|
||||
void set(Sense_KEY key_val, Sense_ASC asc_val = Sense_ASC::NONE, Sense_ASCQ ascq_val = Sense_ASCQ::REASON_UNKNOWN) {
|
||||
key = key_val;
|
||||
asc = asc_val;
|
||||
ascq = ascq_val;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
key = Sense_KEY::NO_SENSE;
|
||||
asc = Sense_ASC::NONE;
|
||||
ascq = Sense_ASCQ::REASON_UNKNOWN;
|
||||
}
|
||||
|
||||
bool has_sense() {
|
||||
return key != Sense_KEY::NO_SENSE;
|
||||
}
|
||||
|
||||
Sense_KEY key;
|
||||
Sense_ASC asc;
|
||||
Sense_ASCQ ascq;
|
||||
};
|
||||
|
||||
#endif /* __MSCUSER_H__ */
|
||||
|
Reference in New Issue
Block a user