Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AVR_Code/USB_BULK_TEST/src/ASF/common/services/usb/udc/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static UDD_EP_t *udd_ep_get_ctrl(udd_ep_id_t ep);
//@{

//! Global variable to give and record information about setup request management
udd_ctrl_request_t udd_g_ctrlreq;
extern udd_ctrl_request_t udd_g_ctrlreq;
Comment thread
turboencabulator marked this conversation as resolved.
Outdated

//! Bit definitions about endpoint control state machine for udd_ep_control_state
typedef enum {
Expand Down
4 changes: 3 additions & 1 deletion AVR_Code/USB_BULK_TEST/src/tiny_calibration.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions AVR_Code/USB_BULK_TEST/src/tiny_calibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
#endif /* TINY_CALIBRATION_H_ */