icE1usb fw: Use proper length for struct usb_cdc_notif_serial_state

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I30d451e76ebd192f037653179b6485b2b43b6dbc
This commit is contained in:
Sylvain Munaut 2024-03-06 19:57:19 +01:00
parent ff9916bb0c
commit 1f29c0fece
1 changed files with 5 additions and 4 deletions

View File

@ -148,6 +148,7 @@ usb_gps_poll(void)
},
.bits = 0x00
};
const int notif_len = sizeof(struct usb_cdc_notif_serial_state);
/* Check if PPS occurred */
uint32_t pps_now = time_pps_read();
@ -159,8 +160,8 @@ usb_gps_poll(void)
/* Queue CD Set */
notif.bits = 1;
usb_data_write(ep_regs->bd[0].ptr, &notif, 12);
ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(10);
usb_data_write(ep_regs->bd[0].ptr, &notif, notif_len);
ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(notif_len);
/* Need to clear in the future */
g_usb_gps.pps.set = true;
@ -169,8 +170,8 @@ usb_gps_poll(void)
{
/* Queue CD Clear */
notif.bits = 0;
usb_data_write(ep_regs->bd[0].ptr, &notif, 12);
ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(10);
usb_data_write(ep_regs->bd[0].ptr, &notif, notif_len);
ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | USB_BD_LEN(notif_len);
/* Cleared */
g_usb_gps.pps.set = false;