diff options
author | thirdpin <n_lazareva@mail.ru> | 2016-07-13 18:22:08 +0300 |
---|---|---|
committer | thirdpin <n_lazareva@mail.ru> | 2016-07-13 18:22:08 +0300 |
commit | 18668d026fa5c799f83ec369a929f8f04117d3ba (patch) | |
tree | d495fbcf2d56c3e7f8322da009788ea7f396c5d1 /emb | |
parent | 03fb98cead3b9b3bf07a786581a7e91817dfcd0e (diff) |
schematic, usb host, usb composite
Diffstat (limited to 'emb')
-rw-r--r-- | emb/pastilda/.cproject | 4 | ||||
-rw-r--r-- | emb/pastilda/.gitignore | 1 | ||||
-rw-r--r-- | emb/pastilda/app/app.cpp | 22 | ||||
-rw-r--r-- | emb/pastilda/app/app.h | 1 | ||||
-rw-r--r-- | emb/pastilda/app/flash_memory.cpp | 141 | ||||
-rw-r--r-- | emb/pastilda/app/flash_memory.h | 31 | ||||
-rw-r--r-- | emb/pastilda/app/leds.cpp | 6 | ||||
-rw-r--r-- | emb/pastilda/app/leds.h | 9 | ||||
-rw-r--r-- | emb/pastilda/hw/clock.h | 15 | ||||
-rw-r--r-- | emb/pastilda/hw/usb_host/usbh_host.cpp | 21 | ||||
-rw-r--r-- | emb/pastilda/hw/usb_host/usbh_host.h | 4 | ||||
m--------- | emb/pastilda/lib/libopencm3_cpp_extensions | 0 | ||||
-rw-r--r-- | emb/pastilda/lib/libusbhost/usbh_config.h | 2 | ||||
-rw-r--r-- | emb/pastilda/lib/libusbhost/usbh_device_driver.h | 4 | ||||
-rw-r--r-- | emb/pastilda/lib/libusbhost/usbh_driver_hid_kbd.c | 10 | ||||
-rw-r--r-- | emb/pastilda/lib/libusbhost/usbh_hubbed.c | 38 | ||||
-rw-r--r-- | emb/pastilda/lib/libusbhost/usbh_lld_stm32f4.c | 59 |
17 files changed, 40 insertions, 328 deletions
diff --git a/emb/pastilda/.cproject b/emb/pastilda/.cproject index 3087e7c..4047913 100644 --- a/emb/pastilda/.cproject +++ b/emb/pastilda/.cproject @@ -51,6 +51,7 @@ <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.657593211" name="Cross ARM C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler"> <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.789067878" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="STM32F4"/> + <listOptionValue builtIn="false" value="USE_STM32F4_USBH_DRIVER_HS"/> </option> <option id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1095580488" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""../..\..\lib\libopencm3\include""/> @@ -60,12 +61,14 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/usb_device}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/usb_host}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib/libusbhost}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib/libopencm3_cpp_extensions}""/> </option> <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.338584563" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/> </tool> <tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.268228352" name="Cross ARM C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler"> <option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.2136368030" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="false" valueType="definedSymbols"> <listOptionValue builtIn="false" value="STM32F4"/> + <listOptionValue builtIn="false" value="USE_STM32F4_USBH_DRIVER_HS"/> </option> <option id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1410012800" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="false" valueType="includePath"> <listOptionValue builtIn="false" value=""../..\..\lib\libopencm3\include""/> @@ -75,6 +78,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/usb_device}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/hw/usb_host}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib/libusbhost}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib/libopencm3_cpp_extensions}""/> </option> <inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.583307617" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/> </tool> diff --git a/emb/pastilda/.gitignore b/emb/pastilda/.gitignore new file mode 100644 index 0000000..3df573f --- /dev/null +++ b/emb/pastilda/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/emb/pastilda/app/app.cpp b/emb/pastilda/app/app.cpp index e969f64..851b564 100644 --- a/emb/pastilda/app/app.cpp +++ b/emb/pastilda/app/app.cpp @@ -17,28 +17,6 @@ App::App() systick_init(); _leds_api = new LEDS_api(); -///////////////////////////////////////////////////////////////////////////////////////// - //spi and cs pin for sst25_driver -// SPI_Conf spi_conf; -// spi_conf.spi_number = 1; -// spi_conf.scl_pin = PA5; -// spi_conf.miso_pin = PA6; -// spi_conf.mosi_pin = PA7; -// _spi_ext = new SPI_ext(spi_conf); -// _spi_ext->disable(); -// _spi_ext->set_baudrate_prescaler(SPI_CPP_Extension::BaudRate::BAUDRATE_FPCLK_DIV_2); -// _spi_ext->set_clock_polarity(SPI_CPP_Extension::Polarity::POLARITY_HIGH); -// _spi_ext->set_clock_phase(Phase::PHASE_HIGH); -// _spi_ext->set_data_drame_format(DataFrameFormat::DFF_8BIT); -// _spi_ext->set_bit_position(BitPos::MSB_FIRST); -// _spi_ext->set_software_slave_management(State::ENABLE); -// _spi_ext->set_nss(NssState::HIGH); -// _spi_ext->enable(); -// -// GPIO_ext cs_pin(PA4); -// cs_pin.mode_setup(Mode::OUTPUT, PullMode::NO_PULL); -// cs_pin.set_output_options(OutputType::PUSH_PULL, Speed::FAST_50MHz); -/////////////////////////////////////////////////////////////////////////////////////////// delay_ms(1000); usb_dispatcher = new USB_dispatcher(); diff --git a/emb/pastilda/app/app.h b/emb/pastilda/app/app.h index 80258e2..ef7f448 100644 --- a/emb/pastilda/app/app.h +++ b/emb/pastilda/app/app.h @@ -24,7 +24,6 @@ namespace Application private: LEDS_api *_leds_api; USB_dispatcher *usb_dispatcher; - SPI_ext *_spi_ext; }; } #endif diff --git a/emb/pastilda/app/flash_memory.cpp b/emb/pastilda/app/flash_memory.cpp deleted file mode 100644 index 23dde5b..0000000 --- a/emb/pastilda/app/flash_memory.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "flash_memory.h" -#include "systick_ext.h" - -#define WBVAL(x) ((x) & 0xFF), (((x) >> 8) & 0xFF) -#define QBVAL(x) ((x) & 0xFF), (((x) >> 8) & 0xFF), (((x) >> 16) & 0xFF), (((x) >> 24) & 0xFF) -#define BYTES_PER_SECTOR 512 -#define SECTORS_PER_CLUSTER 4 -#define RESERVED_SECTORS 1 -#define FAT_COPIES 2 -#define ROOT_ENTRIES 512 - -FlashMemory *flash_pointer; - -FlashMemory::FlashMemory(struct block_device *dev) -{ - flash_pointer = this; - - SPI_CPP_Extension::SPI_Conf sst25_conf = { 1, PB5, PB4, PB3 }; - _spi = new SPI_ext(sst25_conf); - - _spi->reset(); - _spi->disable(); - _spi->set_master_mode(); - _spi->set_baudrate_prescaler(BAUDRATE_FPCLK_DIV_2); - _spi->set_standard_mode(MODE_0); - _spi->set_data_drame_format(DFF_8BIT); - _spi->set_bit_position(MSB_FIRST); - _spi->enable_ss_output(); - _spi->set_software_slave_management(State::ENABLE); - _spi->set_nss(HIGH); - _spi->enable(); - - _sst25 = new SST25(_spi, PA15); - _sst25->disable_wtite_protection(); - - dev->get_sector_size = get_sector_size; - dev->read_sectors = read_sectors; - dev->write_sectors = write_sectors; -} - -uint16_t FlashMemory::get_sector_size(const struct block_device *dev) -{ - (void)dev; - return (FAKE_SECTOR_SIZE); -} - -int FlashMemory::read_sectors(const struct block_device *dev, uint32_t sector, uint32_t count, void *buf) -{ - (void)dev; - uint32_t end_sector = sector + count - 1; - - uint32_t real_start_sector = sector / 8; - uint32_t real_end_sector = end_sector / 8; - uint32_t real_sector_count = real_end_sector - real_start_sector + 1; - - uint32_t data_size = real_sector_count * SECTOR_SIZE; - uint8_t data[data_size]; - - uint32_t ok_sectors = flash_pointer->_sst25->read_sectors(real_start_sector, real_sector_count, data); - - if (ok_sectors != real_sector_count) { - return (0); - } - - uint32_t start_address = (real_start_sector * SECTOR_SIZE) + ((sector % 8) * FAKE_SECTOR_SIZE); - uint32_t end_address = start_address + (count * FAKE_SECTOR_SIZE); - - for (int i = start_address, j = 0; i < end_address; i++, j++) { - ((uint8_t*)buf)[j] = data[i]; - } - - return (count); -} - -int FlashMemory::write_sectors(const struct block_device *dev, uint32_t sector, uint32_t count, const void *buf) -{ - (void)dev; - uint32_t end_sector = sector + count - 1; - - uint32_t real_start_sector = sector / 8; - uint32_t real_end_sector = end_sector / 8; - uint32_t real_sector_count = real_end_sector - real_start_sector + 1; - - - uint32_t copy_size = real_sector_count * SECTOR_SIZE; - uint8_t sector_copy[copy_size]; - - uint32_t ok_sectors = flash_pointer->_sst25->read_sectors(real_start_sector, real_sector_count, sector_copy); - - if (ok_sectors != real_sector_count) { - return (0); - } - - for (int i = 0; i < real_sector_count; i++) { - flash_pointer->_sst25->erase_sector(real_start_sector + i); - } - - uint32_t start_address = (real_start_sector * SECTOR_SIZE) + ((sector % 8) * FAKE_SECTOR_SIZE); - uint32_t end_address = start_address + (count * FAKE_SECTOR_SIZE); - - for (int i = start_address, j = 0; i <= end_address; i++, j++) { - sector_copy[i] = ((uint8_t*)buf)[j]; - } - - ok_sectors = flash_pointer->_sst25->write_sectors(real_start_sector, real_sector_count, sector_copy); - if (ok_sectors != real_sector_count) { - return (0); - } - - - return (count); -} - -int FlashMemory::flash_read(uint32_t lba, uint8_t *copy_to) -{ - memset(copy_to, 0, FAKE_SECTOR_SIZE); - if (lba >= FAKE_SECTOR_COUNT) { - return (1); - } - else { - read_sectors(0, lba, 1, copy_to); - return (0); - } -} -int FlashMemory::flash_write(uint32_t lba, const uint8_t *copy_from) -{ - ///TODO: check for lba > 3 - if (lba >= FAKE_SECTOR_COUNT) { - return (1); - } - else { - write_sectors(0, lba, 1, copy_from); - return (1); - } - // ignore writes - return (0); -} -int FlashMemory::flash_blocks(void) -{ - return (FAKE_SECTOR_COUNT); -} diff --git a/emb/pastilda/app/flash_memory.h b/emb/pastilda/app/flash_memory.h deleted file mode 100644 index 389f0da..0000000 --- a/emb/pastilda/app/flash_memory.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef FLASH_MEMORY_H -#define FLASH_MEMORY_H - -#include <string.h> -#include "blockdev.h" - -#include "spi_ext.h" -#include "SST25.h" - -using namespace SPI_CPP_Extension; - -constexpr uint16_t FAKE_SECTOR_SIZE = 512; -constexpr uint16_t FAKE_SECTOR_COUNT = (MEMORY_SIZE / FAKE_SECTOR_SIZE); - -class FlashMemory -{ -public: - FlashMemory(struct block_device *dev); - static uint16_t get_sector_size(const struct block_device *dev); - static int read_sectors(const struct block_device *dev, uint32_t sector, uint32_t count, void *buf); - static int write_sectors(const struct block_device *dev, uint32_t sector, uint32_t count, const void *buf); - - int flash_read(uint32_t lba, uint8_t *copy_to); - int flash_write(uint32_t lba, const uint8_t *copy_from); - int flash_blocks(void); -private: - SST25 *_sst25; - SPI_ext *_spi; -}; - -#endif diff --git a/emb/pastilda/app/leds.cpp b/emb/pastilda/app/leds.cpp index 5abec58..e000c80 100644 --- a/emb/pastilda/app/leds.cpp +++ b/emb/pastilda/app/leds.cpp @@ -4,10 +4,12 @@ using namespace LEDS_API; LEDS_api::LEDS_api() { - _leds[0] = new GPIO_ext(LED_A); - _leds[1] = new GPIO_ext(LED_B); + _leds[0] = new GPIO_ext(LED_R); + _leds[1] = new GPIO_ext(LED_G); + _leds[2] = new GPIO_ext(LED_B); _leds[0]->mode_setup(Mode::OUTPUT, PullMode::NO_PULL); _leds[1]->mode_setup(Mode::OUTPUT, PullMode::NO_PULL); + _leds[2]->mode_setup(Mode::OUTPUT, PullMode::NO_PULL); _leds_state = LEDS_INI_STATE; _timer_leds_toggle = new TimerMs(TimerMode::CYCLE, LEDS_TOGGLE_PERIOD_MS); diff --git a/emb/pastilda/app/leds.h b/emb/pastilda/app/leds.h index 691d0f0..a04600d 100644 --- a/emb/pastilda/app/leds.h +++ b/emb/pastilda/app/leds.h @@ -8,10 +8,11 @@ using namespace GPIO_CPP_Extension; namespace LEDS_API { - constexpr Pinout LED_A = PD12; - constexpr Pinout LED_B = PD13; - constexpr uint8_t LEDS_COUNT = 0x02; - constexpr uint8_t LEDS_MAX_STATE = 0x02; + constexpr Pinout LED_R = PB0; + constexpr Pinout LED_G = PB1; + constexpr Pinout LED_B = PB3; + constexpr uint8_t LEDS_COUNT = 0x03; + constexpr uint8_t LEDS_MAX_STATE = 0x07; constexpr uint8_t LEDS_INI_STATE = 0x01; constexpr uint32_t LEDS_TOGGLE_PERIOD_MS = 500; diff --git a/emb/pastilda/hw/clock.h b/emb/pastilda/hw/clock.h index 6ad3e43..7cebfd2 100644 --- a/emb/pastilda/hw/clock.h +++ b/emb/pastilda/hw/clock.h @@ -48,20 +48,15 @@ static constexpr struct rcc_clock_scale rcc_hse_8mhz_to_hclk_120mhz = static void clock_setup() { - rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_to_hclk_120mhz); + rcc_clock_setup_hse_3v3(&rcc_hse_25mhz_to_hclk_120mhz); rcc_periph_clock_enable(rcc_periph_clken::RCC_GPIOA); rcc_periph_clock_enable(rcc_periph_clken::RCC_GPIOB); rcc_periph_clock_enable(rcc_periph_clken::RCC_GPIOC); - rcc_periph_clock_enable(rcc_periph_clken::RCC_GPIOD); - rcc_periph_clock_enable(rcc_periph_clken::RCC_USART6); //usb_host helper - rcc_periph_clock_enable(rcc_periph_clken::RCC_TIM6); //usb_host - rcc_periph_clock_enable(rcc_periph_clken::RCC_SPI1); //sst25 - //rcc_periph_clock_enable(rcc_periph_clken::RCC_TIM9); - //rcc_periph_clock_enable(rcc_periph_clken::RCC_PWR); - //rcc_periph_clock_enable(rcc_periph_clken::RCC_SYSCFG); - rcc_periph_clock_enable(rcc_periph_clken::RCC_OTGFS); //device - rcc_periph_clock_enable(rcc_periph_clken::RCC_OTGHS); //host + rcc_periph_clock_enable(rcc_periph_clken::RCC_TIM6); + rcc_periph_clock_enable(rcc_periph_clken::RCC_SPI1); + rcc_periph_clock_enable(rcc_periph_clken::RCC_OTGFS); + rcc_periph_clock_enable(rcc_periph_clken::RCC_OTGHS); } #endif diff --git a/emb/pastilda/hw/usb_host/usbh_host.cpp b/emb/pastilda/hw/usb_host/usbh_host.cpp index 3b92b81..91604cc 100644 --- a/emb/pastilda/hw/usb_host/usbh_host.cpp +++ b/emb/pastilda/hw/usb_host/usbh_host.cpp @@ -12,19 +12,14 @@ USB_host::USB_host(redirect _redirect_callback, control_interception _control_in timer_setup(); oth_hs_setup(); - usart_setup(); hid_kbd_driver_init(&kbd_config); usbh_init(usbh_lld_stm32f4_drivers, device_drivers); - - LOG_PRINTF("USB init complete\n"); - LOG_FLUSH(); } void USB_host::poll() { usbh_poll(get_time_us()); - LOG_FLUSH(); delay_ms(1); } @@ -58,22 +53,6 @@ void USB_host::oth_hs_setup() uf_m.set_af(AF_Number::AF12); } -void USB_host::usart_setup() -{ - GPIO_ext uart_rx(PC6); - GPIO_ext uart_tx(PC7); - - uart_rx.mode_setup(Mode::ALTERNATE_FUNCTION, PullMode::NO_PULL); - uart_tx.mode_setup(Mode::ALTERNATE_FUNCTION, PullMode::NO_PULL); - - uart_rx.set_af(AF_Number::AF8); - uart_tx.set_af(AF_Number::AF8); - -#ifdef USART_DEBUG - usart_init(USART6, 921600); -#endif -} - //convert to 1MHz less precise timer value //units: microseconds uint32_t USB_host::get_time_us() diff --git a/emb/pastilda/hw/usb_host/usbh_host.h b/emb/pastilda/hw/usb_host/usbh_host.h index ff78a18..53efa89 100644 --- a/emb/pastilda/hw/usb_host/usbh_host.h +++ b/emb/pastilda/hw/usb_host/usbh_host.h @@ -2,13 +2,10 @@ #define USBH_HOST_H #include <string.h> -#include <libopencm3/cm3/common.h> -#include <libopencm3/stm32/usart.h> #include "timer_ext.h" #include "gpio_ext.h" #include "systick_ext.h" BEGIN_DECLS -#include "usart_helpers.h" #include "usbh_hubbed.h" #include "usbh_driver_hid_kbd.h" #include "usbh_lld_stm32f4.h" @@ -46,6 +43,5 @@ private: void timer_setup(); uint32_t get_time_us(); void oth_hs_setup(); - void usart_setup(); }; #endif diff --git a/emb/pastilda/lib/libopencm3_cpp_extensions b/emb/pastilda/lib/libopencm3_cpp_extensions new file mode 160000 +Subproject 6f4a4be9040c2fa114a87cb025e3aab9e36cfe7 diff --git a/emb/pastilda/lib/libusbhost/usbh_config.h b/emb/pastilda/lib/libusbhost/usbh_config.h index 4fa38cb..7a7f8df 100644 --- a/emb/pastilda/lib/libusbhost/usbh_config.h +++ b/emb/pastilda/lib/libusbhost/usbh_config.h @@ -23,8 +23,6 @@ #ifndef USBH_CONFIG_ #define USBH_CONFIG_ - - // Max devices per hub #define USBH_HUB_MAX_DEVICES (8) diff --git a/emb/pastilda/lib/libusbhost/usbh_device_driver.h b/emb/pastilda/lib/libusbhost/usbh_device_driver.h index 137b39b..dbab889 100644 --- a/emb/pastilda/lib/libusbhost/usbh_device_driver.h +++ b/emb/pastilda/lib/libusbhost/usbh_device_driver.h @@ -106,10 +106,6 @@ struct _usbh_generic_data { typedef struct _usbh_generic_data usbh_generic_data_t; -#define ERROR(arg) LOG_PRINTF("UNHANDLED_ERROR %d: file: %s, line: %d",\ - arg, __FILE__, __LINE__) - - /// Hub related functions usbh_device_t *usbh_get_free_device(const usbh_device_t *dev); diff --git a/emb/pastilda/lib/libusbhost/usbh_driver_hid_kbd.c b/emb/pastilda/lib/libusbhost/usbh_driver_hid_kbd.c index 29d5008..010d3fa 100644 --- a/emb/pastilda/lib/libusbhost/usbh_driver_hid_kbd.c +++ b/emb/pastilda/lib/libusbhost/usbh_driver_hid_kbd.c @@ -1,7 +1,7 @@ #include "usbh_hubbed.h" -#include "driver/usbh_device_driver.h" +#include "usbh_device_driver.h" #include "usbh_driver_hid_kbd.h" -#include "usart_helpers.h" +//#include "usart_helpers.h" #include <libopencm3/usb/usbstd.h> @@ -47,7 +47,6 @@ void hid_kbd_driver_init(const hid_kbd_config_t *config) static void *init(void *usbh_dev) { if (!initialized) { - LOG_PRINTF("\n%s/%d : driver not initialized\r\n", __FILE__, __LINE__); return (0); } @@ -126,7 +125,6 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_EFATAL: case USBH_PACKET_CALLBACK_STATUS_EAGAIN: - ERROR(cb_data.status); kbd->state_next = STATE_INACTIVE; break; } @@ -135,7 +133,6 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case STATE_SET_CONFIGURATION_EMPTY_READ: { - LOG_PRINTF("|empty packet read|"); switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: kbd->state_next = STATE_SET_CONFIGURATION_COMPLETE; @@ -145,7 +142,6 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: case USBH_PACKET_CALLBACK_STATUS_EFATAL: case USBH_PACKET_CALLBACK_STATUS_EAGAIN: - ERROR(cb_data.status); kbd->state_next = STATE_INACTIVE; break; } @@ -157,13 +153,11 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data) case USBH_PACKET_CALLBACK_STATUS_OK: kbd->state_next = STATE_READING_REQUEST; kbd->endpoint_in_toggle = 0; - LOG_PRINTF("\nKEYBOARD CONFIGURED\n"); break; case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: case USBH_PACKET_CALLBACK_STATUS_EFATAL: case USBH_PACKET_CALLBACK_STATUS_EAGAIN: - ERROR(cb_data.status); kbd->state_next = STATE_INACTIVE; break; } diff --git a/emb/pastilda/lib/libusbhost/usbh_hubbed.c b/emb/pastilda/lib/libusbhost/usbh_hubbed.c index 1921842..0f51bf0 100644 --- a/emb/pastilda/lib/libusbhost/usbh_hubbed.c +++ b/emb/pastilda/lib/libusbhost/usbh_hubbed.c @@ -22,8 +22,8 @@ #include "usbh_config.h" #include "usbh_lld_stm32f4.h" -#include "driver/usbh_device_driver.h" -#include "usart_helpers.h" +#include "usbh_device_driver.h" +//#include "usart_helpers.h" #include <libopencm3/stm32/gpio.h> #include <libopencm3/usb/usbstd.h> @@ -99,14 +99,12 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de usbh_dev_driver_info_t device_info; if (desc_type == USB_DT_DEVICE) { struct usb_device_descriptor *device_desc = (void*)&buf[i]; - LOG_PRINTF("DEVICE DESCRIPTOR"); device_info.deviceClass = device_desc->bDeviceClass; device_info.deviceSubClass = device_desc->bDeviceSubClass; device_info.deviceProtocol = device_desc->bDeviceProtocol; device_info.idVendor = device_desc->idVendor; device_info.idProduct = device_desc->idProduct; - } else { - LOG_PRINTF("INVALID descriptors pointer - fatal error"); + } else {; return; } @@ -117,7 +115,6 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de switch (desc_type) { case USB_DT_INTERFACE: { - LOG_PRINTF("INTERFACE_DESCRIPTOR\n"); struct usb_interface_descriptor *iface = (void*)&buf[i]; device_info.ifaceClass = iface->bInterfaceClass; device_info.ifaceSubClass = iface->bInterfaceSubClass; @@ -127,7 +124,6 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de dev->drv = driver; dev->drvdata = dev->drv->init(dev); if (!dev->drvdata) { - LOG_PRINTF("CANT TOUCH THIS"); } break; } @@ -138,7 +134,6 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de } if (desc_len == 0) { - LOG_PRINTF("PROBLEM WITH PARSE %d\n",i); return; } i += desc_len; @@ -147,20 +142,16 @@ static void device_register(void *descriptors, uint16_t descriptors_len, usbh_de if (dev->drv && dev->drvdata) { // analyze descriptors - LOG_PRINTF("ANALYZE"); i = 0; while (i < descriptors_len) { desc_len = buf[i]; void *drvdata = dev->drvdata; - LOG_PRINTF("[%d]",buf[i+1]); if (dev->drv->analyze_descriptor(drvdata, &buf[i])) { - LOG_PRINTF("Device Initialized\n"); return; } i += desc_len; } } - LOG_PRINTF("Device NOT Initialized\n"); } void usbh_init(const void *drivers_lld[], const usbh_dev_driver_t * const device_drivers[]) @@ -175,7 +166,6 @@ void usbh_init(const void *drivers_lld[], const usbh_dev_driver_t * const device // TODO: init structures uint32_t k = 0; while (usbh_data.lld_drivers[k]) { - LOG_PRINTF("DRIVER %d\n", k); usbh_device_t * usbh_device = ((usbh_generic_data_t *)(usbh_data.lld_drivers[k])->driver_data)->usbh_device; @@ -185,7 +175,6 @@ void usbh_init(const void *drivers_lld[], const usbh_dev_driver_t * const device usbh_device[i].drv = 0; usbh_device[i].drvdata = 0; } - LOG_PRINTF("DRIVER %d", k); usbh_data.lld_drivers[k]->init(usbh_data.lld_drivers[k]->driver_data); k++; @@ -208,7 +197,6 @@ void device_xfer_control_write(void *data, uint16_t datalen, usbh_packet_callbac packet.toggle = &dev->toggle0; usbh_write(dev, &packet); - LOG_PRINTF("WR@device...%d | \n", dev->address); } void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback_t callback, usbh_device_t *dev) @@ -227,7 +215,6 @@ void device_xfer_control_read(void *data, uint16_t datalen, usbh_packet_callback packet.toggle = &dev->toggle0; usbh_read(dev, &packet); - LOG_PRINTF("RD@device...%d | \n", dev->address); } bool usbh_enum_available(void) @@ -242,14 +229,11 @@ usbh_device_t *usbh_get_free_device(const usbh_device_t *dev) usbh_device_t *usbh_device = lld_data->usbh_device; uint8_t i; - LOG_PRINTF("DEV ADDRESS%d\n", dev->address); for (i = 0; i < USBH_MAX_DEVICES; i++) { if (usbh_device[i].address < 0) { - LOG_PRINTF("\t\t\t\t\tFOUND: %d", i); usbh_device[i].address = i+1; return &usbh_device[i]; } else { - LOG_PRINTF("address: %d\n\n\n", usbh_device[i].address); } } @@ -276,7 +260,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ switch (cb_data.status) { case USBH_PACKET_CALLBACK_STATUS_OK: dev->state++; - LOG_PRINTF("::%d::", dev->address); device_xfer_control_read(0, 0, device_enumerate, dev); break; @@ -284,7 +267,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -295,7 +277,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_OK: if (dev->address == 0) { dev->address = usbh_data.address_temporary; - LOG_PRINTF("ADDR: %d\n", dev->address); } struct usb_setup_data setup_data; @@ -315,7 +296,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } break; @@ -341,7 +321,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EFATAL: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -386,7 +365,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EFATAL: case USBH_PACKET_CALLBACK_STATUS_EAGAIN: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -405,7 +383,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -419,7 +396,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ struct usb_config_descriptor *cdt = (struct usb_config_descriptor *)&usbh_buffer[USB_DT_DEVICE_SIZE]; struct usb_setup_data setup_data; - LOG_PRINTF("WRITE: LEN: %d", cdt->wTotalLength); setup_data.bmRequestType = 0b10000000; setup_data.bRequest = USB_REQ_GET_DESCRIPTOR; setup_data.wValue = USB_DT_CONFIGURATION << 8; @@ -450,7 +426,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_EFATAL: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -473,7 +448,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } } @@ -486,7 +460,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ { struct usb_config_descriptor *cdt = (struct usb_config_descriptor *)&usbh_buffer[USB_DT_DEVICE_SIZE]; - LOG_PRINTF("TOTAL_LENGTH: %d\n", cdt->wTotalLength); device_register(usbh_buffer, cdt->wTotalLength + USB_DT_DEVICE_SIZE, dev); dev->state++; @@ -498,7 +471,6 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ case USBH_PACKET_CALLBACK_STATUS_EAGAIN: case USBH_PACKET_CALLBACK_STATUS_ERRSIZ: device_enumeration_terminate(dev); - ERROR(cb_data.status); break; } @@ -506,12 +478,10 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_ break; default: - LOG_PRINTF("Error: Unknown state "__FILE__"/%d\n", __LINE__); break; } if (state_start == dev->state) { - LOG_PRINTF("\n !HANG %d\n", state_start); } } @@ -532,7 +502,6 @@ void device_enumeration_start(usbh_device_t *dev) usbh_data.address_temporary = address; - LOG_PRINTF("\n\n\n ENUMERATION OF DEVICE@%d STARTED \n\n", address); struct usb_setup_data setup_data; @@ -559,7 +528,6 @@ void usbh_poll(uint32_t time_curr_us) switch (poll_status) { case USBH_POLL_STATUS_DEVICE_CONNECTED: // New device found - LOG_PRINTF("\nDEVICE FOUND\n"); usbh_device[0].lld = usbh_data.lld_drivers[k]; usbh_device[0].speed = usbh_data.lld_drivers[k]->root_speed(lld_data); usbh_device[0].address = 1; diff --git a/emb/pastilda/lib/libusbhost/usbh_lld_stm32f4.c b/emb/pastilda/lib/libusbhost/usbh_lld_stm32f4.c index 606f059..ba7c7ce 100644 --- a/emb/pastilda/lib/libusbhost/usbh_lld_stm32f4.c +++ b/emb/pastilda/lib/libusbhost/usbh_lld_stm32f4.c @@ -20,9 +20,9 @@ * */ -#include "driver/usbh_device_driver.h" +#include "usbh_device_driver.h" #include "usbh_lld_stm32f4.h" -#include "usart_helpers.h" +//#include "usart_helpers.h" #include <string.h> #include <stdint.h> @@ -166,7 +166,6 @@ static void stm32f4_usbh_port_channel_setup( eptyp = OTG_HCCHAR_EPTYP_ISOCHRONOUS; break; default: - LOG_PRINTF("\n\n\n\nWRONG EP TYPE\n\n\n\n\n"); return; } @@ -198,7 +197,6 @@ static void read(void *drvdata, usbh_packet_t *packet) int8_t channel = get_free_channel(dev); if (channel == -1) { // BIG PROBLEM - LOG_PRINTF("FATAL ERROR IN, NO CHANNEL LEFT \n"); usbh_packet_callback_data_t cb_data; cb_data.status = USBH_PACKET_CALLBACK_STATUS_EFATAL; cb_data.transferred_length = 0; @@ -246,7 +244,6 @@ static void write(void *drvdata, const usbh_packet_t *packet) if (channel == -1) { // BIG PROBLEM - LOG_PRINTF("FATAL ERROR OUT, NO CHANNEL LEFT \n"); usbh_packet_callback_data_t cb_data; cb_data.status = USBH_PACKET_CALLBACK_STATUS_EFATAL; cb_data.transferred_length = 0; @@ -275,7 +272,6 @@ static void write(void *drvdata, const usbh_packet_t *packet) } } else { dpid = OTG_HCTSIZ_DPID_DATA0; // ! TODO: BUG - LOG_PRINTF("BUG, %d",__LINE__); } uint32_t num_packets; @@ -299,10 +295,8 @@ static void write(void *drvdata, const usbh_packet_t *packet) volatile uint32_t *fifo = &REBASE_CH(OTG_FIFO, channel) + RX_FIFO_SIZE; const uint32_t * buf32 = packet->data; int i; - LOG_PRINTF("\nSending[%d]: ", packet->datalen); for(i = packet->datalen; i >= 4; i-=4) { const uint8_t *buf8 = (const uint8_t *)buf32; - LOG_PRINTF("%02X %02X %02X %02X, ", buf8[0], buf8[1], buf8[2], buf8[3]); *fifo++ = *buf32++; } @@ -311,10 +305,8 @@ static void write(void *drvdata, const usbh_packet_t *packet) *fifo = *buf32&((1 << (8*i)) - 1); uint8_t *buf8 = (uint8_t *)buf32; while (i--) { - LOG_PRINTF("%02X ", *buf8++); } } - LOG_PRINTF("\n"); } else { volatile uint32_t *fifo = &REBASE_CH(OTG_FIFO, channel) + @@ -325,7 +317,6 @@ static void write(void *drvdata, const usbh_packet_t *packet) *fifo++ = *buf32++; } } - LOG_PRINTF("->WRITE %08X\n", REBASE_CH(OTG_HCCHAR, channel)); } static void rxflvl_handle(void *drvdata) @@ -358,7 +349,6 @@ static void rxflvl_handle(void *drvdata) if ( channels[channel].data_index < channels[channel].packet.datalen) { if (len == channels[channel].packet.endpoint_size_max) { REBASE_CH(OTG_HCCHAR, channel) |= OTG_HCCHAR_CHENA; - LOG_PRINTF("CHENA[%d/%d] ", channels[channel].data_index, channels[channel].packet.datalen); } } @@ -410,7 +400,6 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) REBASE(OTG_HFIR) = (REBASE(OTG_HFIR) & ~OTG_HFIR_FRIVL_MASK) | 48000; if ((REBASE(OTG_HCFG) & OTG_HCFG_FSLSPCS_MASK) != OTG_HCFG_FSLSPCS_48MHz) { REBASE(OTG_HCFG) = (REBASE(OTG_HCFG) & ~OTG_HCFG_FSLSPCS_MASK) | OTG_HCFG_FSLSPCS_48MHz; - LOG_PRINTF("\n Reset Full-Speed \n"); } channels_init(dev); dev->dpstate = DEVICE_POLL_STATE_DEVRST; @@ -420,7 +409,6 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) REBASE(OTG_HFIR) = (REBASE(OTG_HFIR) & ~OTG_HFIR_FRIVL_MASK) | 6000; if ((REBASE(OTG_HCFG) & OTG_HCFG_FSLSPCS_MASK) != OTG_HCFG_FSLSPCS_6MHz) { REBASE(OTG_HCFG) = (REBASE(OTG_HCFG) & ~OTG_HCFG_FSLSPCS_MASK) | OTG_HCFG_FSLSPCS_6MHz; - LOG_PRINTF("\n Reset Low-Speed \n"); } channels_init(dev); @@ -458,7 +446,6 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) // To clear interrupt write 0 to PENA // To disable port write 1 to PENCHNG REBASE(OTG_HPRT) &= ~OTG_HPRT_PENA; - LOG_PRINTF("PENCHNG"); if ((hprt & OTG_HPRT_PENA)) { return USBH_POLL_STATUS_DEVICE_CONNECTED; } @@ -468,13 +455,11 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (REBASE(OTG_HPRT) & OTG_HPRT_POCCHNG) { // TODO: Check for functionality REBASE(OTG_HPRT) |= OTG_HPRT_POCCHNG; - LOG_PRINTF("POCCHNG"); } } if (REBASE(OTG_GINTSTS) & OTG_GINTSTS_DISCINT) { REBASE(OTG_GINTSTS) = OTG_GINTSTS_DISCINT; - LOG_PRINTF("DISCINT"); /* * When the voltage drops, DISCINT interrupt is generated although @@ -482,7 +467,6 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) * Often, DISCINT is bad interpreted upon insertion of device */ if (!(REBASE(OTG_HPRT) & OTG_HPRT_PCSTS)) { - LOG_PRINTF("discint processsing..."); channels_init(dev); } reg = REBASE(OTG_GINTSTS); @@ -508,7 +492,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_NAK) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_NAK; - LOG_PRINTF("NAK"); + REBASE_CH(OTG_HCCHAR, channel) |= OTG_HCCHAR_CHENA; @@ -516,7 +500,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_ACK) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_ACK; - LOG_PRINTF("ACK"); + if (eptyp == USBH_EPTYP_CONTROL) { channels[channel].packet.toggle[0] = 1; } else { @@ -526,7 +510,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_XFRC) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_XFRC; - LOG_PRINTF("XFRC"); + free_channel(dev, channel); @@ -542,7 +526,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_FRMOR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_FRMOR; - LOG_PRINTF("FRMOR"); + usbh_packet_callback_data_t cb_data; cb_data.status = USBH_PACKET_CALLBACK_STATUS_EFATAL; @@ -556,7 +540,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_TXERR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_TXERR; - LOG_PRINTF("TXERR"); + free_channel(dev, channel); @@ -573,7 +557,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_STALL) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_STALL; - LOG_PRINTF("STALL"); + free_channel(dev, channel); @@ -589,7 +573,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_CHH) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_CHH; - LOG_PRINTF("CHH"); + free_channel(dev, channel); } @@ -598,7 +582,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_NAK) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_NAK; if (eptyp == USBH_EPTYP_CONTROL) { - LOG_PRINTF("NAK"); + } REBASE_CH(OTG_HCCHAR, channel) |= OTG_HCCHAR_CHENA; @@ -607,12 +591,12 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_DTERR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_DTERR; - LOG_PRINTF("DTERR"); + } if (hcint & OTG_HCINT_ACK) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_ACK; - LOG_PRINTF("ACK"); + channels[channel].packet.toggle[0] ^= 1; @@ -622,7 +606,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_XFRC) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_XFRC; - LOG_PRINTF("XFRC"); + free_channel(dev, channel); usbh_packet_callback_data_t cb_data; @@ -642,7 +626,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_BBERR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_BBERR; - LOG_PRINTF("BBERR"); + free_channel(dev, channel); usbh_packet_callback_data_t cb_data; @@ -656,13 +640,12 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_FRMOR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_FRMOR; - LOG_PRINTF("FRMOR"); } if (hcint & OTG_HCINT_TXERR) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_TXERR; - LOG_PRINTF("TXERR"); + free_channel(dev, channel); @@ -678,7 +661,7 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (hcint & OTG_HCINT_STALL) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_STALL; - LOG_PRINTF("STALL"); + free_channel(dev, channel); @@ -693,7 +676,6 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) } if (hcint & OTG_HCINT_CHH) { REBASE_CH(OTG_HCINT, channel) = OTG_HCINT_CHH; - LOG_PRINTF("CHH"); free_channel(dev, channel); } @@ -703,12 +685,10 @@ static enum USBH_POLL_STATUS poll_run(usbh_lld_stm32f4_driver_data_t *dev) if (REBASE(OTG_GINTSTS) & OTG_GINTSTS_MMIS) { REBASE(OTG_GINTSTS) = OTG_GINTSTS_MMIS; - LOG_PRINTF("Mode mismatch"); } if (REBASE(OTG_GINTSTS) & OTG_GINTSTS_IPXFR) { REBASE(OTG_GINTSTS) = OTG_GINTSTS_IPXFR; - LOG_PRINTF("IPXFR"); } return USBH_POLL_STATUS_NONE; @@ -843,8 +823,6 @@ static void poll_init(usbh_lld_stm32f4_driver_data_t *dev) // Uncomment to enable Interrupt generation REBASE(OTG_GAHBCFG) |= OTG_GAHBCFG_GINT; - LOG_PRINTF("INIT COMPLETE\n"); - // Finish dev->state = DEVICE_STATE_RUN; dev->dpstate = DEVICE_POLL_STATE_DISCONN; @@ -856,7 +834,6 @@ static void poll_init(usbh_lld_stm32f4_driver_data_t *dev) if (done) { dev->poll_sequence++; dev->timestamp_us = dev->time_curr_us; - LOG_PRINTF("\t\t POLL SEQUENCE %d\n", dev->poll_sequence); } } @@ -867,10 +844,7 @@ static void poll_reset(usbh_lld_stm32f4_driver_data_t *dev) REBASE(OTG_HPRT) &= ~OTG_HPRT_PRST; dev->state = dev->state_prev; dev->state_prev = DEVICE_STATE_RESET; - - LOG_PRINTF("RESET"); } else { - LOG_PRINTF("waiting %d < %d\n",dev->time_curr_us, dev->timestamp_us); } } @@ -946,7 +920,6 @@ static void free_channel(void *drvdata, uint8_t channel) if (REBASE_CH(OTG_HCCHAR, channel) & OTG_HCCHAR_CHENA) { REBASE_CH(OTG_HCCHAR, channel) |= OTG_HCCHAR_CHDIS; REBASE_CH(OTG_HCINT, channel) = ~0; - LOG_PRINTF("\nDisabling channel %d\n", channel); } else { channels[channel].state = CHANNEL_STATE_FREE; } |