summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-16 15:29:34 +0700
committerhathach <[email protected]>2023-06-16 15:29:34 +0700
commite754795d3adec4bc3a66a4131d0662d87acb4893 (patch)
tree281212f5852f6ce9d2a607aab3e0acea94c2e708 /src
parenta7f330fa94b7a39858f6d770737451b51f061c25 (diff)
fix build warnings
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/typec/typec_stm32.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/portable/st/typec/typec_stm32.c b/src/portable/st/typec/typec_stm32.c
index 231da5450..bf8b660f0 100644
--- a/src/portable/st/typec/typec_stm32.c
+++ b/src/portable/st/typec/typec_stm32.c
@@ -183,9 +183,9 @@ bool tcd_init(uint8_t rhport, uint32_t port_type) {
// Read Voltage State on CC1 & CC2 fore initial state
uint32_t v_cc[2];
+ (void) v_cc;
v_cc[0] = (UCPD1->SR >> UCPD_SR_TYPEC_VSTATE_CC1_Pos) & 0x03;
v_cc[1] = (UCPD1->SR >> UCPD_SR_TYPEC_VSTATE_CC2_Pos) & 0x03;
-
TU_LOG1("Initial VState CC1 = %lu, CC2 = %lu\r\n", v_cc[0], v_cc[1]);
// Enable CC1 & CC2 Interrupt
@@ -308,8 +308,11 @@ void tcd_int_handler(uint8_t rhport) {
if (!(sr & UCPD_SR_RXERR)) {
// response with good crc
- _good_crc.msg_id = ((pd_header_t const*) _rx_buf)->msg_id;
- dma_tx_start(rhport, &_good_crc, 2);
+ // TODO move this to usbc stack
+ if (_rx_buf) {
+ _good_crc.msg_id = ((pd_header_t const *) _rx_buf)->msg_id;
+ dma_tx_start(rhport, &_good_crc, 2);
+ }
result = XFER_RESULT_SUCCESS;
}else {