diff --git a/AVR_Code/USB_BULK_TEST/src/ASF/common/services/usb/udc/udc.c b/AVR_Code/USB_BULK_TEST/src/ASF/common/services/usb/udc/udc.c index 123928a27..bdb4bfb32 100644 --- a/AVR_Code/USB_BULK_TEST/src/ASF/common/services/usb/udc/udc.c +++ b/AVR_Code/USB_BULK_TEST/src/ASF/common/services/usb/udc/udc.c @@ -1102,7 +1102,7 @@ static bool udc_reqvend(void){ uds.calValPos = cali_value_positive_gradient; uds.CALA = DFLLRC2M.CALA; uds.CALB = DFLLRC2M.CALB; - udd_set_setup_payload(&uds, udd_g_ctrlreq.req.wLength); + udd_set_setup_payload((uint8_t *) &uds, udd_g_ctrlreq.req.wLength); //asm("nop"); return 1; case 0xa1: //Receive waveform for signal gen @@ -1212,7 +1212,7 @@ static bool udc_reqvend(void){ : "memory"); __builtin_unreachable(); case 0xa8: //Firmware Version Request - udd_set_setup_payload(&firmver, udd_g_ctrlreq.req.wLength); + udd_set_setup_payload((uint8_t *) &firmver, udd_g_ctrlreq.req.wLength); return 1; case 0xa9: //Variant Version Request udd_set_setup_payload(&variant, udd_g_ctrlreq.req.wLength); diff --git a/AVR_Code/USB_BULK_TEST/src/main.c b/AVR_Code/USB_BULK_TEST/src/main.c index 70b7fbdd9..18f5f02d4 100644 --- a/AVR_Code/USB_BULK_TEST/src/main.c +++ b/AVR_Code/USB_BULK_TEST/src/main.c @@ -164,9 +164,6 @@ int main(void){ } } -//! Global variable to give and record information about setup request management -udd_ctrl_request_t udd_g_ctrlreq; - //CALLBACKS: void main_suspend_action(void) { diff --git a/AVR_Code/USB_BULK_TEST/src/tiny_calibration.c b/AVR_Code/USB_BULK_TEST/src/tiny_calibration.c index a1ac1c4c9..64374af8a 100644 --- a/AVR_Code/USB_BULK_TEST/src/tiny_calibration.c +++ b/AVR_Code/USB_BULK_TEST/src/tiny_calibration.c @@ -10,6 +10,8 @@ #include "tiny_adc.h" volatile unsigned char median_TRFCNT_delay = 255; +volatile unsigned char cali_value_positive_gradient; +volatile unsigned char cali_value_negative_gradient; void tiny_calibration_init(){ //Set up 48MHz DFLL for USB. @@ -46,7 +48,7 @@ void tiny_calibration_init(){ return; } -tiny_calibration_first_sof(){ +void tiny_calibration_first_sof(){ PR.PRPE &= 0b11111110; TC_CALI.PER = 23999; TC_CALI.CNT = 12000; diff --git a/AVR_Code/USB_BULK_TEST/src/tiny_calibration.h b/AVR_Code/USB_BULK_TEST/src/tiny_calibration.h index edd9e0f35..1e580a9ad 100644 --- a/AVR_Code/USB_BULK_TEST/src/tiny_calibration.h +++ b/AVR_Code/USB_BULK_TEST/src/tiny_calibration.h @@ -25,8 +25,8 @@ void tiny_calibration_synchronise_phase(unsigned int phase, unsigned int precisi extern volatile unsigned char calibration_values_found; extern volatile unsigned char median_TRFCNT_delay; -volatile unsigned char cali_value_negative_gradient; -volatile unsigned char cali_value_positive_gradient; +extern volatile unsigned char cali_value_negative_gradient; +extern volatile unsigned char cali_value_positive_gradient; -#endif /* TINY_CALIBRATION_H_ */ \ No newline at end of file +#endif /* TINY_CALIBRATION_H_ */