Drop C-style 'void' argument
This commit is contained in:
		@@ -25,7 +25,7 @@
 | 
			
		||||
 | 
			
		||||
#if ENABLED(SDIO_SUPPORT)
 | 
			
		||||
 | 
			
		||||
bool SDIO_Init(void);
 | 
			
		||||
bool SDIO_Init();
 | 
			
		||||
bool SDIO_ReadBlock(uint32_t block, uint8_t *dst);
 | 
			
		||||
bool SDIO_WriteBlock(uint32_t block, const uint8_t *src);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -128,7 +128,7 @@ public:
 | 
			
		||||
  static Sd2Card& getSd2Card() { return sd2card; }
 | 
			
		||||
 | 
			
		||||
  #if ENABLED(AUTO_REPORT_SD_STATUS)
 | 
			
		||||
    static void auto_report_sd_status(void);
 | 
			
		||||
    static void auto_report_sd_status();
 | 
			
		||||
    static inline void set_auto_report_interval(uint8_t v) {
 | 
			
		||||
      #if NUM_SERIAL > 1
 | 
			
		||||
        auto_report_port = serial_port_index;
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ void USB::init() {
 | 
			
		||||
  bmHubPre = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint8_t USB::getUsbTaskState(void) {
 | 
			
		||||
uint8_t USB::getUsbTaskState() {
 | 
			
		||||
  return usb_task_state;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -424,7 +424,7 @@ uint8_t USB::dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* USB main task. Performs enumeration/cleanup */
 | 
			
		||||
void USB::Task(void) { //USB state machine
 | 
			
		||||
void USB::Task() { //USB state machine
 | 
			
		||||
  uint8_t rcode;
 | 
			
		||||
  uint8_t tmpdata;
 | 
			
		||||
  static uint32_t delay = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -216,7 +216,7 @@ class USB : public MAX3421E {
 | 
			
		||||
  uint8_t bmHubPre;
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  USB(void);
 | 
			
		||||
  USB();
 | 
			
		||||
 | 
			
		||||
  void SetHubPreMask() {
 | 
			
		||||
    bmHubPre |= bmHUBPRE;
 | 
			
		||||
@@ -243,7 +243,7 @@ public:
 | 
			
		||||
  void ForEachUsbDevice(UsbDeviceHandleFunc pfunc) {
 | 
			
		||||
    addrPool.ForEachUsbDevice(pfunc);
 | 
			
		||||
  };
 | 
			
		||||
  uint8_t getUsbTaskState(void);
 | 
			
		||||
  uint8_t getUsbTaskState();
 | 
			
		||||
  void setUsbTaskState(uint8_t state);
 | 
			
		||||
 | 
			
		||||
  EpInfo* getEpInfoEntry(uint8_t addr, uint8_t ep);
 | 
			
		||||
@@ -265,7 +265,7 @@ public:
 | 
			
		||||
  uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
 | 
			
		||||
  uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
 | 
			
		||||
 | 
			
		||||
  void Task(void);
 | 
			
		||||
  void Task();
 | 
			
		||||
 | 
			
		||||
  uint8_t DefaultAddressing(uint8_t parent, uint8_t port, bool lowspeed);
 | 
			
		||||
  uint8_t Configuring(uint8_t parent, uint8_t port, bool lowspeed);
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ class ConfigDescParser : public USBReadParser {
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
  void SetOR(void) { UseOr = true; }
 | 
			
		||||
  void SetOR() { UseOr = true; }
 | 
			
		||||
  ConfigDescParser(UsbConfigXtracter *xtractor);
 | 
			
		||||
  void Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset);
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -74,19 +74,19 @@ void E_Notify(double d, int lvl) {
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG_USB_HOST
 | 
			
		||||
 | 
			
		||||
  void NotifyFailGetDevDescr(void) {
 | 
			
		||||
  void NotifyFailGetDevDescr() {
 | 
			
		||||
    Notify(PSTR("\r\ngetDevDescr "), 0x80);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void NotifyFailSetDevTblEntry(void) {
 | 
			
		||||
  void NotifyFailSetDevTblEntry() {
 | 
			
		||||
    Notify(PSTR("\r\nsetDevTblEn "), 0x80);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void NotifyFailGetConfDescr(void) {
 | 
			
		||||
  void NotifyFailGetConfDescr() {
 | 
			
		||||
    Notify(PSTR("\r\ngetConf "), 0x80);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  void NotifyFailSetConfDescr(void) {
 | 
			
		||||
  void NotifyFailSetConfDescr() {
 | 
			
		||||
    Notify(PSTR("\r\nsetConf "), 0x80);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -43,10 +43,10 @@ void E_Notifyc(char c, int lvl);
 | 
			
		||||
  void NotifyFailSetDevTblEntry(uint8_t reason);
 | 
			
		||||
  void NotifyFailGetConfDescr(uint8_t reason);
 | 
			
		||||
  void NotifyFailSetConfDescr(uint8_t reason);
 | 
			
		||||
  void NotifyFailGetDevDescr(void);
 | 
			
		||||
  void NotifyFailSetDevTblEntry(void);
 | 
			
		||||
  void NotifyFailGetConfDescr(void);
 | 
			
		||||
  void NotifyFailSetConfDescr(void);
 | 
			
		||||
  void NotifyFailGetDevDescr();
 | 
			
		||||
  void NotifyFailSetDevTblEntry();
 | 
			
		||||
  void NotifyFailGetConfDescr();
 | 
			
		||||
  void NotifyFailSetConfDescr();
 | 
			
		||||
  void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID);
 | 
			
		||||
  void NotifyFail(uint8_t rcode);
 | 
			
		||||
#else
 | 
			
		||||
 
 | 
			
		||||
@@ -194,7 +194,7 @@ void MAX3421e::busprobe() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MAX3421 state change task and interrupt handler
 | 
			
		||||
uint8_t MAX3421e::Task(void) {
 | 
			
		||||
uint8_t MAX3421e::Task() {
 | 
			
		||||
  return READ(USB_INTR_PIN) ? 0 : IntHandler();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ class MAX3421e {
 | 
			
		||||
    uint8_t   gpioRd();
 | 
			
		||||
    bool      reset();
 | 
			
		||||
 | 
			
		||||
    uint8_t   getVbusState(void)   {return vbusState;};
 | 
			
		||||
    uint8_t   getVbusState()   {return vbusState;};
 | 
			
		||||
 | 
			
		||||
    void busprobe();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -98,7 +98,7 @@ struct UHS_BULK_CommandBlockWrapperBase {
 | 
			
		||||
        volatile uint8_t bmCBWFlags;
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
        UHS_BULK_CommandBlockWrapperBase(void) {
 | 
			
		||||
        UHS_BULK_CommandBlockWrapperBase() {
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        UHS_BULK_CommandBlockWrapperBase(uint32_t tag, uint32_t xflen, uint8_t flgs) :
 | 
			
		||||
@@ -181,11 +181,11 @@ public:
 | 
			
		||||
 | 
			
		||||
        volatile UHS_EpInfo epInfo[MASS_MAX_ENDPOINTS];
 | 
			
		||||
 | 
			
		||||
        uint8_t GetbMaxLUN(void) {
 | 
			
		||||
        uint8_t GetbMaxLUN() {
 | 
			
		||||
                return bMaxLUN; // Max LUN
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        uint8_t GetbTheLUN(void) {
 | 
			
		||||
        uint8_t GetbTheLUN() {
 | 
			
		||||
                return bTheLUN; // Active LUN
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -203,23 +203,23 @@ public:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        // Configure and internal methods, these should never be called by a user's sketch.
 | 
			
		||||
        uint8_t Start(void);
 | 
			
		||||
        uint8_t Start();
 | 
			
		||||
        bool OKtoEnumerate(ENUMERATION_INFO *ei);
 | 
			
		||||
        uint8_t SetInterface(ENUMERATION_INFO *ei);
 | 
			
		||||
 | 
			
		||||
        uint8_t GetAddress(void) {
 | 
			
		||||
        uint8_t GetAddress() {
 | 
			
		||||
                return bAddress;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        void Poll(void);
 | 
			
		||||
        void Poll();
 | 
			
		||||
 | 
			
		||||
        void DriverDefaults(void);
 | 
			
		||||
        void DriverDefaults();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
        void Reset(void);
 | 
			
		||||
        void CheckMedia(void);
 | 
			
		||||
        void Reset();
 | 
			
		||||
        void CheckMedia();
 | 
			
		||||
 | 
			
		||||
        bool IsValidCBW(uint8_t size, uint8_t *pcbw);
 | 
			
		||||
        bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw);
 | 
			
		||||
 
 | 
			
		||||
@@ -378,7 +378,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::SetInterface(ENUMERATION_INFO *ei) {
 | 
			
		||||
 *
 | 
			
		||||
 * @return 0 for success
 | 
			
		||||
 */
 | 
			
		||||
uint8_t UHS_NI UHS_Bulk_Storage::Start(void) {
 | 
			
		||||
uint8_t UHS_NI UHS_Bulk_Storage::Start() {
 | 
			
		||||
        uint8_t rcode;
 | 
			
		||||
        //        Serial.print("Bulk Start from USB Host @ 0x");
 | 
			
		||||
        //        Serial.println((uint32_t)pUsb, HEX);
 | 
			
		||||
@@ -541,7 +541,7 @@ Fail:
 | 
			
		||||
 *
 | 
			
		||||
 * @return
 | 
			
		||||
 */
 | 
			
		||||
//void UHS_NI UHS_Bulk_Storage::Release(void) {
 | 
			
		||||
//void UHS_NI UHS_Bulk_Storage::Release() {
 | 
			
		||||
//        pUsb->DisablePoll();
 | 
			
		||||
//        OnRelease();
 | 
			
		||||
//        DriverDefaults();
 | 
			
		||||
@@ -602,7 +602,7 @@ bool UHS_NI UHS_Bulk_Storage::CheckLUN(uint8_t lun) {
 | 
			
		||||
 *
 | 
			
		||||
 * Scan for media change on all LUNs
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::CheckMedia(void) {
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::CheckMedia() {
 | 
			
		||||
        if(!bAddress) return;
 | 
			
		||||
        for(uint8_t lun = 0; lun <= bMaxLUN; lun++) {
 | 
			
		||||
                if(TestUnitReady(lun)) {
 | 
			
		||||
@@ -630,7 +630,7 @@ void UHS_NI UHS_Bulk_Storage::CheckMedia(void) {
 | 
			
		||||
 * For driver use only.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::Poll(void) {
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::Poll() {
 | 
			
		||||
        if((long)(millis() - qNextPollTime) >= 0L) {
 | 
			
		||||
 | 
			
		||||
                CheckMedia();
 | 
			
		||||
@@ -841,7 +841,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::ClearEpHalt(uint8_t index) {
 | 
			
		||||
 * For driver use only.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::Reset(void) {
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::Reset() {
 | 
			
		||||
        if(!bAddress) return;
 | 
			
		||||
 | 
			
		||||
        while(pUsb->ctrlReq(bAddress, mkSETUP_PKT16(UHS_BULK_bmREQ_OUT, UHS_BULK_REQ_BOMSR, 0x0000U, bIface, 0), 0, NULL) == 0x01) {
 | 
			
		||||
@@ -858,7 +858,7 @@ void UHS_NI UHS_Bulk_Storage::Reset(void) {
 | 
			
		||||
 *
 | 
			
		||||
 * @return 0 if successful
 | 
			
		||||
 */
 | 
			
		||||
uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery(void) {
 | 
			
		||||
uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery() {
 | 
			
		||||
        if(!bAddress) return UHS_BULK_ERR_DEVICE_DISCONNECTED;
 | 
			
		||||
        Notify(PSTR("\r\nResetRecovery\r\n"), 0x80);
 | 
			
		||||
        Notify(PSTR("-----------------\r\n"), 0x80);
 | 
			
		||||
@@ -883,7 +883,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::ResetRecovery(void) {
 | 
			
		||||
 *
 | 
			
		||||
 * Clear all EP data and clear all LUN status
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::DriverDefaults(void) {
 | 
			
		||||
void UHS_NI UHS_Bulk_Storage::DriverDefaults() {
 | 
			
		||||
 | 
			
		||||
        pUsb->DeviceDefaults(MASS_MAX_ENDPOINTS, this);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -158,7 +158,7 @@ class AddressPool {
 | 
			
		||||
                InitEntry(index);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void InitAllAddresses(void) {
 | 
			
		||||
        void InitAllAddresses() {
 | 
			
		||||
                for(uint8_t i = 1; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) InitEntry(i);
 | 
			
		||||
                hubCounter = 0;
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ public:
 | 
			
		||||
        HexDumper() : byteCount(0), byteTotal(0) {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        void Initialize(void) {
 | 
			
		||||
        void Initialize() {
 | 
			
		||||
                byteCount = 0;
 | 
			
		||||
                byteTotal = 0;
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
@@ -43,10 +43,10 @@ void NotifyFailGetDevDescr(uint8_t reason);
 | 
			
		||||
void NotifyFailSetDevTblEntry(uint8_t reason);
 | 
			
		||||
void NotifyFailGetConfDescr(uint8_t reason);
 | 
			
		||||
void NotifyFailSetConfDescr(uint8_t reason);
 | 
			
		||||
void NotifyFailGetDevDescr(void);
 | 
			
		||||
void NotifyFailSetDevTblEntry(void);
 | 
			
		||||
void NotifyFailGetConfDescr(void);
 | 
			
		||||
void NotifyFailSetConfDescr(void);
 | 
			
		||||
void NotifyFailGetDevDescr();
 | 
			
		||||
void NotifyFailSetDevTblEntry();
 | 
			
		||||
void NotifyFailGetConfDescr();
 | 
			
		||||
void NotifyFailSetConfDescr();
 | 
			
		||||
void NotifyFailUnknownDevice(uint16_t VID, uint16_t PID);
 | 
			
		||||
void NotifyFail(uint8_t rcode);
 | 
			
		||||
#else
 | 
			
		||||
 
 | 
			
		||||
@@ -171,7 +171,7 @@ extern "C" {
 | 
			
		||||
 | 
			
		||||
#ifdef __AVR__
 | 
			
		||||
// The only wierdo in the bunch...
 | 
			
		||||
void UHS_AVR_printf_HELPER_init(void) {
 | 
			
		||||
void UHS_AVR_printf_HELPER_init() {
 | 
			
		||||
        // Set up stdio/stderr
 | 
			
		||||
        tty_stdio.put = tty_std_putc;
 | 
			
		||||
        tty_stdio.get = tty_std_getc;
 | 
			
		||||
 
 | 
			
		||||
@@ -69,7 +69,7 @@ public:
 | 
			
		||||
        volatile uint8_t usb_host_speed;
 | 
			
		||||
        volatile uint8_t hub_present;
 | 
			
		||||
 | 
			
		||||
        UHS_USB_HOST_BASE(void) {
 | 
			
		||||
        UHS_USB_HOST_BASE() {
 | 
			
		||||
                for(uint16_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++) {
 | 
			
		||||
                        devConfig[i] = NULL;
 | 
			
		||||
                }
 | 
			
		||||
@@ -110,7 +110,7 @@ public:
 | 
			
		||||
        virtual void UHS_NI vbusPower(NOTUSED(VBUS_t state)) {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI Task(void) {
 | 
			
		||||
        virtual void UHS_NI Task() {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual uint8_t UHS_NI SetAddress(NOTUSED(uint8_t addr), NOTUSED(uint8_t ep), NOTUSED(UHS_EpInfo **ppep), NOTUSED(uint16_t &nak_limit)) {
 | 
			
		||||
@@ -137,27 +137,27 @@ public:
 | 
			
		||||
                return UHS_HOST_ERROR_NOT_IMPLEMENTED;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual uint8_t UHS_NI init(void) {
 | 
			
		||||
        virtual uint8_t UHS_NI init() {
 | 
			
		||||
                return 0;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI doHostReset(void) {
 | 
			
		||||
        virtual void UHS_NI doHostReset() {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual int16_t UHS_NI Init(NOTUSED(int16_t mseconds)) {
 | 
			
		||||
                return -1;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual int16_t UHS_NI Init(void) {
 | 
			
		||||
        virtual int16_t UHS_NI Init() {
 | 
			
		||||
                return Init(INT16_MIN);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual uint8_t hwlPowerUp(void) {
 | 
			
		||||
        virtual uint8_t hwlPowerUp() {
 | 
			
		||||
                /* This is for machine specific support to enable/power up the USB HW to operate*/
 | 
			
		||||
                return UHS_HOST_ERROR_NOT_IMPLEMENTED;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual uint8_t hwPowerDown(void) {
 | 
			
		||||
        virtual uint8_t hwPowerDown() {
 | 
			
		||||
                /* This is for machine specific support to disable/powerdown the USB Hw */
 | 
			
		||||
                return UHS_HOST_ERROR_NOT_IMPLEMENTED;
 | 
			
		||||
        };
 | 
			
		||||
@@ -166,13 +166,13 @@ public:
 | 
			
		||||
                return (klass == UHS_USB_CLASS_HUB);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI suspend_host(void) {
 | 
			
		||||
        virtual void UHS_NI suspend_host() {
 | 
			
		||||
                // Used on MCU that lack control of IRQ priority (AVR).
 | 
			
		||||
                // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed.
 | 
			
		||||
                // NOTE: you must track the state yourself!
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI resume_host(void) {
 | 
			
		||||
        virtual void UHS_NI resume_host() {
 | 
			
		||||
                // Used on MCU that lack control of IRQ priority (AVR).
 | 
			
		||||
                // Resumes ISRs.
 | 
			
		||||
                // NOTE: you must track the state yourself!
 | 
			
		||||
@@ -184,7 +184,7 @@ public:
 | 
			
		||||
        //
 | 
			
		||||
        /////////////////////////////////////////////
 | 
			
		||||
        // these two probably will go away, and won't be used, TBD
 | 
			
		||||
        inline void Poll_Others(void) {
 | 
			
		||||
        inline void Poll_Others() {
 | 
			
		||||
#ifdef UHS_LOAD_BT
 | 
			
		||||
                UHS_BT_Poll(this);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -193,14 +193,14 @@ public:
 | 
			
		||||
#endif
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        inline void DisablePoll(void) {
 | 
			
		||||
        inline void DisablePoll() {
 | 
			
		||||
                noInterrupts();
 | 
			
		||||
                usb_task_polling_disabled++;
 | 
			
		||||
                DDSB();
 | 
			
		||||
                interrupts();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        inline void EnablePoll(void) {
 | 
			
		||||
        inline void EnablePoll() {
 | 
			
		||||
                noInterrupts();
 | 
			
		||||
                usb_task_polling_disabled--;
 | 
			
		||||
                DDSB();
 | 
			
		||||
@@ -233,11 +233,11 @@ public:
 | 
			
		||||
 | 
			
		||||
        UHS_EpInfo* UHS_NI getEpInfoEntry(uint8_t addr, uint8_t ep);
 | 
			
		||||
 | 
			
		||||
        inline uint8_t getUsbTaskState(void) {
 | 
			
		||||
        inline uint8_t getUsbTaskState() {
 | 
			
		||||
                return ( usb_task_state);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        inline AddressPool* GetAddressPool(void) {
 | 
			
		||||
        inline AddressPool* GetAddressPool() {
 | 
			
		||||
                return &addrPool;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@@ -289,7 +289,7 @@ public:
 | 
			
		||||
         * Resets interface driver to unused state. You should override this in
 | 
			
		||||
         * your driver if it requires extra class variable cleanup.
 | 
			
		||||
         */
 | 
			
		||||
        virtual void DriverDefaults(void) {
 | 
			
		||||
        virtual void DriverDefaults() {
 | 
			
		||||
                printf("Default driver defaults.\r\n");
 | 
			
		||||
                pUsb->DeviceDefaults(bNumEP, this);
 | 
			
		||||
        };
 | 
			
		||||
@@ -325,7 +325,7 @@ public:
 | 
			
		||||
         *
 | 
			
		||||
         * @return zero on success
 | 
			
		||||
         */
 | 
			
		||||
        virtual uint8_t Finalize(void) {
 | 
			
		||||
        virtual uint8_t Finalize() {
 | 
			
		||||
                return 0;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@@ -334,7 +334,7 @@ public:
 | 
			
		||||
         *
 | 
			
		||||
         * @return 0 on success
 | 
			
		||||
         */
 | 
			
		||||
        virtual uint8_t OnStart(void) {
 | 
			
		||||
        virtual uint8_t OnStart() {
 | 
			
		||||
                return 0;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@@ -342,7 +342,7 @@ public:
 | 
			
		||||
         * Start interface polling
 | 
			
		||||
         * @return
 | 
			
		||||
         */
 | 
			
		||||
        virtual uint8_t Start(void) {
 | 
			
		||||
        virtual uint8_t Start() {
 | 
			
		||||
                uint8_t rcode = OnStart();
 | 
			
		||||
                if(!rcode) bPollEnable = true;
 | 
			
		||||
                return rcode;
 | 
			
		||||
@@ -352,7 +352,7 @@ public:
 | 
			
		||||
         * Executed before anything else in Release().
 | 
			
		||||
         *
 | 
			
		||||
         */
 | 
			
		||||
        virtual void OnRelease(void) {
 | 
			
		||||
        virtual void OnRelease() {
 | 
			
		||||
                return;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@@ -360,7 +360,7 @@ public:
 | 
			
		||||
         * Release resources when device is disconnected.
 | 
			
		||||
         * Normally this does not need to be overridden.
 | 
			
		||||
         */
 | 
			
		||||
        virtual void Release(void) {
 | 
			
		||||
        virtual void Release() {
 | 
			
		||||
                OnRelease();
 | 
			
		||||
                DriverDefaults();
 | 
			
		||||
                return;
 | 
			
		||||
@@ -375,7 +375,7 @@ public:
 | 
			
		||||
         * Button state/joystick position/etc changes on a HID device.
 | 
			
		||||
         * Flow control status change on a communication device, e.g. CTS on serial
 | 
			
		||||
         */
 | 
			
		||||
        virtual void OnPoll(void) {
 | 
			
		||||
        virtual void OnPoll() {
 | 
			
		||||
                return;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
@@ -389,7 +389,7 @@ public:
 | 
			
		||||
                qNextPollTime = millis() + 100;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual bool UHS_NI Polling(void) {
 | 
			
		||||
        virtual bool UHS_NI Polling() {
 | 
			
		||||
                return bPollEnable;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -434,10 +434,10 @@ public:
 | 
			
		||||
        UHS_VSI(UHS_USB_HOST_BASE *p);
 | 
			
		||||
        bool OKtoEnumerate(ENUMERATION_INFO *ei);
 | 
			
		||||
        uint8_t SetInterface(ENUMERATION_INFO *ei);
 | 
			
		||||
        virtual void DriverDefaults(void);
 | 
			
		||||
        virtual void Release(void);
 | 
			
		||||
        virtual void DriverDefaults();
 | 
			
		||||
        virtual void Release();
 | 
			
		||||
 | 
			
		||||
        uint8_t GetAddress(void) {
 | 
			
		||||
        uint8_t GetAddress() {
 | 
			
		||||
                return bAddress;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -74,19 +74,19 @@ void E_Notify(double d, int lvl) {
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG_USB_HOST
 | 
			
		||||
 | 
			
		||||
void NotifyFailGetDevDescr(void) {
 | 
			
		||||
void NotifyFailGetDevDescr() {
 | 
			
		||||
        Notify(PSTR("\r\ngetDevDescr "), 0x80);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NotifyFailSetDevTblEntry(void) {
 | 
			
		||||
void NotifyFailSetDevTblEntry() {
 | 
			
		||||
        Notify(PSTR("\r\nsetDevTblEn "), 0x80);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NotifyFailGetConfDescr(void) {
 | 
			
		||||
void NotifyFailGetConfDescr() {
 | 
			
		||||
        Notify(PSTR("\r\ngetConf "), 0x80);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void NotifyFailSetConfDescr(void) {
 | 
			
		||||
void NotifyFailSetConfDescr() {
 | 
			
		||||
        Notify(PSTR("\r\nsetConf "), 0x80);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -330,7 +330,7 @@ public:
 | 
			
		||||
        uint8_t irq_pin;
 | 
			
		||||
        // Will use the defaults UHS_MAX3421E_SS, UHS_MAX3421E_INT and speed
 | 
			
		||||
 | 
			
		||||
        UHS_NI MAX3421E_HOST(void) {
 | 
			
		||||
        UHS_NI MAX3421E_HOST() {
 | 
			
		||||
                sof_countdown = 0;
 | 
			
		||||
                busevent = false;
 | 
			
		||||
                doingreset = false;
 | 
			
		||||
@@ -394,7 +394,7 @@ public:
 | 
			
		||||
                regWr(rPINCTL, (bmFDUPSPI | bmIRQ_SENSE) | (uint8_t)(state));
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        void UHS_NI Task(void);
 | 
			
		||||
        void UHS_NI Task();
 | 
			
		||||
 | 
			
		||||
        virtual uint8_t SetAddress(uint8_t addr, uint8_t ep, UHS_EpInfo **ppep, uint16_t &nak_limit);
 | 
			
		||||
        virtual uint8_t OutTransfer(UHS_EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8_t *data);
 | 
			
		||||
@@ -403,7 +403,7 @@ public:
 | 
			
		||||
        virtual uint8_t ctrlReqRead(UHS_EpInfo *pep, uint16_t *left, uint16_t *read, uint16_t nbytes, uint8_t *dataptr);
 | 
			
		||||
        virtual uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
 | 
			
		||||
 | 
			
		||||
        void UHS_NI ReleaseChildren(void) {
 | 
			
		||||
        void UHS_NI ReleaseChildren() {
 | 
			
		||||
                for(uint8_t i = 0; i < UHS_HOST_MAX_INTERFACE_DRIVERS; i++)
 | 
			
		||||
                        if(devConfig[i])
 | 
			
		||||
                                devConfig[i]->Release();
 | 
			
		||||
@@ -418,9 +418,9 @@ public:
 | 
			
		||||
                return false;
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void VBUS_changed(void);
 | 
			
		||||
        virtual void VBUS_changed();
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI doHostReset(void) {
 | 
			
		||||
        virtual void UHS_NI doHostReset() {
 | 
			
		||||
#if USB_HOST_SHIELD_USE_ISR
 | 
			
		||||
                // Enable interrupts
 | 
			
		||||
                noInterrupts();
 | 
			
		||||
@@ -469,32 +469,32 @@ public:
 | 
			
		||||
 | 
			
		||||
        int16_t UHS_NI Init(int16_t mseconds);
 | 
			
		||||
 | 
			
		||||
        int16_t UHS_NI Init(void) {
 | 
			
		||||
        int16_t UHS_NI Init() {
 | 
			
		||||
                return Init(INT16_MIN);
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        void ISRTask(void);
 | 
			
		||||
        void ISRbottom(void);
 | 
			
		||||
        void busprobe(void);
 | 
			
		||||
        uint16_t reset(void);
 | 
			
		||||
        void ISRTask();
 | 
			
		||||
        void ISRbottom();
 | 
			
		||||
        void busprobe();
 | 
			
		||||
        uint16_t reset();
 | 
			
		||||
 | 
			
		||||
        // MAX3421e specific
 | 
			
		||||
        void regWr(uint8_t reg, uint8_t data);
 | 
			
		||||
        void gpioWr(uint8_t data);
 | 
			
		||||
        uint8_t regRd(uint8_t reg);
 | 
			
		||||
        uint8_t gpioRd(void);
 | 
			
		||||
        uint8_t gpioRd();
 | 
			
		||||
        uint8_t* bytesWr(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
 | 
			
		||||
        uint8_t* bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* data_p);
 | 
			
		||||
 | 
			
		||||
        // ARM/NVIC specific, used to emulate reentrant ISR.
 | 
			
		||||
#ifdef SWI_IRQ_NUM
 | 
			
		||||
 | 
			
		||||
        void dyn_SWISR(void) {
 | 
			
		||||
        void dyn_SWISR() {
 | 
			
		||||
                ISRbottom();
 | 
			
		||||
        };
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI suspend_host(void) {
 | 
			
		||||
        virtual void UHS_NI suspend_host() {
 | 
			
		||||
                // Used on MCU that lack control of IRQ priority (AVR).
 | 
			
		||||
                // Suspends ISRs, for critical code. IRQ will be serviced after it is resumed.
 | 
			
		||||
                // NOTE: you must track the state yourself!
 | 
			
		||||
@@ -505,7 +505,7 @@ public:
 | 
			
		||||
#endif
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        virtual void UHS_NI resume_host(void);
 | 
			
		||||
        virtual void UHS_NI resume_host();
 | 
			
		||||
};
 | 
			
		||||
#ifndef SPIclass
 | 
			
		||||
#define SPIclass SPI
 | 
			
		||||
 
 | 
			
		||||
@@ -34,18 +34,18 @@ e-mail   :  support@circuitsathome.com
 | 
			
		||||
static MAX3421E_HOST *ISReven;
 | 
			
		||||
static MAX3421E_HOST *ISRodd;
 | 
			
		||||
 | 
			
		||||
static void UHS_NI call_ISReven(void) {
 | 
			
		||||
static void UHS_NI call_ISReven() {
 | 
			
		||||
        ISReven->ISRTask();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void UHS_NI call_ISRodd(void) {
 | 
			
		||||
static void UHS_NI call_ISRodd() {
 | 
			
		||||
        UHS_PIN_WRITE(LED_BUILTIN, HIGH);
 | 
			
		||||
        ISRodd->ISRTask();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void UHS_NI MAX3421E_HOST::resume_host(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::resume_host() {
 | 
			
		||||
                // Used on MCU that lack control of IRQ priority (AVR).
 | 
			
		||||
                // Resumes ISRs.
 | 
			
		||||
                // NOTE: you must track the state yourself!
 | 
			
		||||
@@ -133,7 +133,7 @@ uint8_t* UHS_NI MAX3421E_HOST::bytesRd(uint8_t reg, uint8_t nbytes, uint8_t* dat
 | 
			
		||||
/* GPIO read. See gpioWr for explanation */
 | 
			
		||||
 | 
			
		||||
/* GPIN pins are in high nibbles of IOPINS1, IOPINS2    */
 | 
			
		||||
uint8_t UHS_NI MAX3421E_HOST::gpioRd(void) {
 | 
			
		||||
uint8_t UHS_NI MAX3421E_HOST::gpioRd() {
 | 
			
		||||
        uint8_t gpin = 0;
 | 
			
		||||
        gpin = regRd(rIOPINS2); //pins 4-7
 | 
			
		||||
        gpin &= 0xf0; //clean lower nibble
 | 
			
		||||
@@ -143,7 +143,7 @@ uint8_t UHS_NI MAX3421E_HOST::gpioRd(void) {
 | 
			
		||||
 | 
			
		||||
/* reset MAX3421E. Returns number of microseconds it took for PLL to stabilize after reset
 | 
			
		||||
  or zero if PLL haven't stabilized in 65535 cycles */
 | 
			
		||||
uint16_t UHS_NI MAX3421E_HOST::reset(void) {
 | 
			
		||||
uint16_t UHS_NI MAX3421E_HOST::reset() {
 | 
			
		||||
        uint16_t i = 0;
 | 
			
		||||
 | 
			
		||||
        // Initiate chip reset
 | 
			
		||||
@@ -167,7 +167,7 @@ uint16_t UHS_NI MAX3421E_HOST::reset(void) {
 | 
			
		||||
        return (i);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void UHS_NI MAX3421E_HOST::VBUS_changed(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::VBUS_changed() {
 | 
			
		||||
        /* modify USB task state because Vbus changed or unknown */
 | 
			
		||||
        uint8_t speed = 1;
 | 
			
		||||
        //printf("\r\n\r\n\r\n\r\nSTATE %2.2x -> ", usb_task_state);
 | 
			
		||||
@@ -214,7 +214,7 @@ void UHS_NI MAX3421E_HOST::VBUS_changed(void) {
 | 
			
		||||
 *  Probe bus to determine device presence and speed,
 | 
			
		||||
 *  then switch host to detected speed.
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI MAX3421E_HOST::busprobe(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::busprobe() {
 | 
			
		||||
        uint8_t bus_sample;
 | 
			
		||||
        uint8_t tmpdata;
 | 
			
		||||
        bus_sample = regRd(rHRSL); //Get J,K status
 | 
			
		||||
@@ -760,7 +760,7 @@ uint8_t UHS_NI MAX3421E_HOST::ctrlReqClose(UHS_EpInfo *pep, uint8_t bmReqType, u
 | 
			
		||||
/**
 | 
			
		||||
 * Bottom half of the ISR task
 | 
			
		||||
 */
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRbottom(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRbottom() {
 | 
			
		||||
        uint8_t x;
 | 
			
		||||
        //        Serial.print("Enter ");
 | 
			
		||||
        //        Serial.print((uint32_t)this,HEX);
 | 
			
		||||
@@ -879,12 +879,12 @@ void UHS_NI MAX3421E_HOST::ISRbottom(void) {
 | 
			
		||||
/* USB main task. Services the MAX3421e */
 | 
			
		||||
#if !USB_HOST_SHIELD_USE_ISR
 | 
			
		||||
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRTask(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRTask() {
 | 
			
		||||
}
 | 
			
		||||
void UHS_NI MAX3421E_HOST::Task(void)
 | 
			
		||||
void UHS_NI MAX3421E_HOST::Task()
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
void UHS_NI MAX3421E_HOST::Task(void) {
 | 
			
		||||
void UHS_NI MAX3421E_HOST::Task() {
 | 
			
		||||
#ifdef USB_HOST_MANUAL_POLL
 | 
			
		||||
        if(usb_task_state == UHS_USB_HOST_STATE_RUNNING) {
 | 
			
		||||
                noInterrupts();
 | 
			
		||||
@@ -896,7 +896,7 @@ void UHS_NI MAX3421E_HOST::Task(void) {
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRTask(void)
 | 
			
		||||
void UHS_NI MAX3421E_HOST::ISRTask()
 | 
			
		||||
#endif
 | 
			
		||||
{
 | 
			
		||||
        DDSB();
 | 
			
		||||
 
 | 
			
		||||
@@ -42,12 +42,12 @@ extern "C" {
 | 
			
		||||
}
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
__attribute__((always_inline)) static inline void __DSB(void) {
 | 
			
		||||
__attribute__((always_inline)) static inline void __DSB() {
 | 
			
		||||
        __asm__ volatile ("dsb");
 | 
			
		||||
}
 | 
			
		||||
#endif // defined(__USE_CMSIS_VECTORS__)
 | 
			
		||||
#else // defined(__arm__)
 | 
			
		||||
__attribute__((always_inline)) static inline void __DSB(void) {
 | 
			
		||||
__attribute__((always_inline)) static inline void __DSB() {
 | 
			
		||||
        __asm__ volatile ("sync" : : : "memory");
 | 
			
		||||
}
 | 
			
		||||
#endif // defined(__arm__)
 | 
			
		||||
@@ -66,12 +66,12 @@ void
 | 
			
		||||
#else
 | 
			
		||||
        __attribute__((interrupt(),nomips16))
 | 
			
		||||
#endif
 | 
			
		||||
        softISR(void) {
 | 
			
		||||
        softISR() {
 | 
			
		||||
#else
 | 
			
		||||
#ifdef ARDUINO_spresense_ast
 | 
			
		||||
unsigned int softISR(void) {
 | 
			
		||||
unsigned int softISR() {
 | 
			
		||||
#else
 | 
			
		||||
void softISR(void) {
 | 
			
		||||
void softISR() {
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
@@ -121,9 +121,9 @@ void softISR(void) {
 | 
			
		||||
#ifdef __arm__
 | 
			
		||||
#ifndef interruptsStatus
 | 
			
		||||
#define interruptsStatus() __interruptsStatus()
 | 
			
		||||
static inline unsigned char __interruptsStatus(void) __attribute__((always_inline, unused));
 | 
			
		||||
static inline unsigned char __interruptsStatus() __attribute__((always_inline, unused));
 | 
			
		||||
 | 
			
		||||
static inline unsigned char __interruptsStatus(void) {
 | 
			
		||||
static inline unsigned char __interruptsStatus() {
 | 
			
		||||
        unsigned int primask;
 | 
			
		||||
        asm volatile ("mrs %0, primask" : "=r" (primask));
 | 
			
		||||
        if(primask) return 0;
 | 
			
		||||
@@ -134,7 +134,7 @@ static inline unsigned char __interruptsStatus(void) {
 | 
			
		||||
/**
 | 
			
		||||
 * Initialize the Dynamic (class) Software Interrupt
 | 
			
		||||
 */
 | 
			
		||||
static void Init_dyn_SWI(void) {
 | 
			
		||||
static void Init_dyn_SWI() {
 | 
			
		||||
        if(!dyn_SWI_initied) {
 | 
			
		||||
#ifdef __USE_CMSIS_VECTORS__
 | 
			
		||||
                uint32_t *X_Vectors = (uint32_t*)SCB->VTOR;
 | 
			
		||||
@@ -201,7 +201,7 @@ int exec_SWI(const dyn_SWI* klass) {
 | 
			
		||||
/**
 | 
			
		||||
 * Initialize the Dynamic (class) Software Interrupt
 | 
			
		||||
 */
 | 
			
		||||
static void Init_dyn_SWI(void) {
 | 
			
		||||
static void Init_dyn_SWI() {
 | 
			
		||||
        if(!dyn_SWI_initied) {
 | 
			
		||||
                uint32_t sreg = disableInterrupts();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@ extern "C"
 | 
			
		||||
#else
 | 
			
		||||
                __attribute__((interrupt(),nomips16))
 | 
			
		||||
#endif
 | 
			
		||||
                softISR(void);
 | 
			
		||||
                softISR();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
@@ -149,7 +149,7 @@ public:
 | 
			
		||||
        /**
 | 
			
		||||
         * Override this method with your code.
 | 
			
		||||
         */
 | 
			
		||||
        virtual void dyn_SWISR(void) {
 | 
			
		||||
        virtual void dyn_SWISR() {
 | 
			
		||||
        };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user