Skip to content

Commit

Permalink
Small refactor, separate pool decl/def
Browse files Browse the repository at this point in the history
  • Loading branch information
kauwua committed Feb 22, 2024
1 parent f2a89d5 commit 451ae17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/wch-ch56x-lib/USBDevice/usb20.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,11 @@ usb2_in_transfer_handler(uint8_t endp_num)
LOG_IF(LOG_LEVEL_DEBUG, LOG_ID_USB2,
"End of IN transfer for ENDP %d \r\n", endp_num);
*T_Len = 0;
*usb2_get_tx_endpoint_addr_reg(endp_num) = (uint32_t)endp->buffer;
if (endp_num == 0)
if (endp_num != 0)
{
*usb2_get_tx_endpoint_addr_reg(endp_num) = (uint32_t)endp->buffer;
}
else
{
*usb2_get_rx_endpoint_addr_reg(0) = (uint32_t)usb2_backend_current_device->endpoints.rx[0].buffer;
}
Expand Down
3 changes: 3 additions & 0 deletions src/wch-ch56x-lib/memory/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ typedef struct hydra_pool_t
.size = _size, \
.type_size = sizeof(_type) }

#define HYDRA_POOL_DECLR(_name) \
extern hydra_pool_t _name;

/**
* @brief Get a free pool member
* @param pool pointer to the pool
Expand Down

0 comments on commit 451ae17

Please sign in to comment.