there are still files??

This commit is contained in:
EspoTek 2016-12-28 10:18:45 +11:00
parent d46528726e
commit 667452acb4
18 changed files with 6624 additions and 7355 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -690,13 +690,13 @@ bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, uint8_t * buf,
&& udd_endpoint_is_stall(ep_ctrl)) {
return false; // Endpoint is halted
}
flags = cpu_irq_save();
//flags = cpu_irq_save();
if (ptr_job->busy == true) {
cpu_irq_restore(flags);
//cpu_irq_restore(flags);
return false; // Job already on going
}
ptr_job->busy = true;
cpu_irq_restore(flags);
//cpu_irq_restore(flags);
// Update Job information

View File

@ -57,6 +57,9 @@ extern volatile unsigned char precalc_DMA_CH1_DESTADDR0_b2_state_equals_1;
extern volatile unsigned char precalc_DMA_CH1_DESTADDR1_b2_state_equals_0;
extern volatile unsigned char precalc_DMA_CH1_DESTADDR1_b2_state_equals_1;
extern volatile unsigned char readyToInit;
#endif /* GLOBALS_H_ */

View File

@ -46,6 +46,8 @@ volatile unsigned char precalc_DMA_CH1_DESTADDR0_b2_state_equals_1;
volatile unsigned char precalc_DMA_CH1_DESTADDR1_b2_state_equals_0;
volatile unsigned char precalc_DMA_CH1_DESTADDR1_b2_state_equals_1;
volatile unsigned char usb_state_prev;
volatile unsigned char readyToInit = 0;
int main(void){
@ -119,35 +121,6 @@ void main_resume_action(void)
void main_sof_action(void)
{
switch(global_mode){
case 0:
tiny_dma_loop_mode_0();
break;
case 1:
tiny_dma_loop_mode_1();
break;
case 2:
tiny_dma_loop_mode_2();
break;
case 3:
tiny_dma_loop_mode_3();
break;
case 4:
tiny_dma_loop_mode_4();
break;
case 6:
tiny_dma_loop_mode_6();
break;
case 7:
tiny_dma_loop_mode_7();
break;
default:
break;
}
cli();
usb_state = !usb_state;
sei();
return;
}
bool main_vendor_enable(void)
@ -189,6 +162,7 @@ void iso_callback2(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_
void iso_callback3(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
udi_vendor_iso_in_run3((uint8_t *)&isoBuf[usb_state * PACKET_SIZE + 500], 250, iso_callback3);
//if((int8_t) USB.FIFORP > -16) udi_vendor_iso_in_run((uint8_t *)&isoBuf[!usb_state * PACKET_SIZE + 500], PACKET_SIZE, iso_callback);
usb_state = !usb_state;
return;
}

View File

@ -29,10 +29,6 @@ void tiny_dma_flush(void){
DMA.CH3.CTRLA = 0x00;
DMA.CH3.CTRLA = DMA_CH_RESET_bm;
b1_state = 0;
b2_state = 0;
usb_state = 0;
}
void tiny_dma_set_mode_0(void){
@ -94,7 +90,11 @@ void tiny_dma_set_mode_0(void){
DMA.CH0.DESTADDR2 = 0x00;
//Must enable last for REPCNT won't work!
b1_state = 0;
b2_state = 0;
usb_state = 0;
DMA.CH0.CTRLA |= DMA_CH_ENABLE_bm; //Enable!
readyToInit = 1;
}
void tiny_dma_loop_mode_0(void){
@ -642,16 +642,26 @@ ISR(DMA_CH0_vect){
DMA.CH0.DESTADDR0 = precalc_DMA_CH0_DESTADDR0_b1_state_equals_0;
DMA.CH0.DESTADDR1 = precalc_DMA_CH0_DESTADDR1_b1_state_equals_0;
}
//Must enable last for REPCNT won't work!
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
asm("nop");
DMA.CH0.CTRLA |= DMA_CH_ENABLE_bm; //Enable!
EVSYS.STROBE = 0x02;
EVSYS.STROBE=0x02;
b1_state = !b1_state;
DMA.INTFLAGS = 0x01;
/*
switch(global_mode){
case 0:

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.1.0, 2016-12-27T18:26:57. -->
<!-- Written by QtCreator 4.1.0, 2016-12-27T18:47:03. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

Binary file not shown.