Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
avr-virtual-usb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tech
inf
public
avr-virtual-usb
Commits
111ba2de
Commit
111ba2de
authored
11 years ago
by
Marco Tinner
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
5834a379
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/config.h
+1
-1
1 addition, 1 deletion
src/config.h
src/usb_common.c
+26
-19
26 additions, 19 deletions
src/usb_common.c
with
27 additions
and
20 deletions
src/config.h
+
1
−
1
View file @
111ba2de
...
...
@@ -64,7 +64,7 @@
#define USB_EP1_NUM EP_1 // Endpoint number (identifier)
#define USB_EP1_TYPE USB_EP_TYPE_INTERRUPT // Endpoint Type
#define USB_EP1_DIR USB_EP_DIR_IN
#define USB_EP1_SIZE EP_SIZE_
25
6
#define USB_EP1_SIZE EP_SIZE_6
4
// descriptor values
#define USB_EP1_bEndpointAddress (USB_EP1_NUM | USB_EP_DIR_INbm) // Endpoint address
#define USB_EP1_bmAttributes USB_EP1_TYPE // Transfer type
...
...
This diff is collapsed.
Click to expand it.
src/usb_common.c
+
26
−
19
View file @
111ba2de
...
...
@@ -156,21 +156,21 @@ void handelEP1IRQ(){
if
(
Is_usb_in_ready
())
{
uart_write_string
(
"In"
);
Usb_ack_in_ready
();
//Usb_send_control_in();
/*
uint16_t bytesToSend =
getAvailableBytes(&outBuffer
);
uint16_t
bytesToSend
=
uart_avail_read
(
);
if
(
bytesToSend
>
0
){
uint16_t
i
=
0
;
while
(
i
<
bytesToSend
){
//
Usb_write_byte(0x01);
//
Usb_write_byte(0x60);
Usb_write_byte(
getByteFromBuffer(&outBuffer
));
Usb_write_byte
(
0x01
);
Usb_write_byte
(
0x60
);
Usb_write_byte
(
uart_read
(
));
i
++
;
}
}
*/
Usb_ack_in_ready
();
while
(
Is_usb_read_enabled
()){
}
Usb_ack_fifocon
();
...
...
@@ -182,14 +182,14 @@ void handelEP2IRQ(){
{
uart_write_string
(
"Out"
);
Usb_ack_receive_out
();
//
uint16_t bytesToReceive = Usb_frame_number();
//
if(bytesToReceive>0){
//
uint16_t i = 0;
//
while(i < bytesToReceive){
//
fillBuffer(&inBuffer,
Usb_read_byte());
//
i++;
//
}
//
}
uint16_t
bytesToReceive
=
Usb_frame_number
();
if
(
bytesToReceive
>
0
){
uint16_t
i
=
0
;
while
(
i
<
bytesToReceive
){
uart_write
(
Usb_read_byte
());
i
++
;
}
}
}
}
...
...
@@ -314,30 +314,37 @@ ISR (USB_GEN_vect)
uart_write_string
(
"End of reset, "
);
usb_configuration_nb
=
0
;
Usb_reset_endpoint
(
EP_CONTROL
);
Usb_select_endpoint
(
EP_CONTROL
);
Usb_enable_endpoint
();
usb_configure_endpoint
(
EP_CONTROL
,
USB_EP_TYPE_CONTROL
,
USB_EP_DIR_OUT
,
EP_SIZE_64
,
EP_ONE_BANK
,
EP_NYET_DISABLED
);
Usb_enable_receive_setup_interrupt
();
// Endpoint 1
Usb_reset_endpoint
(
USB_EP1_NUM
);
Usb_select_endpoint
(
USB_EP1_NUM
);
Usb_enable_endpoint
();
usb_configure_endpoint
(
USB_EP1_NUM
,
USB_EP1_TYPE
,
USB_EP1_DIR
,
USB_EP1_SIZE
,
EP_ONE_BANK
,
EP_NYET_ENABLED
);
Usb_enable_in_ready_interrupt
();
// Endpoint 2
Usb_reset_endpoint
(
USB_EP2_NUM
);
Usb_select_endpoint
(
USB_EP2_NUM
);
Usb_enable_endpoint
();
usb_configure_endpoint
(
USB_EP2_NUM
,
USB_EP2_TYPE
,
USB_EP2_DIR
,
USB_EP2_SIZE
,
EP_ONE_BANK
,
EP_NYET_ENABLED
);
Usb_enable_receive_out_interrupt
();
// Endpoint 3
Usb_reset_endpoint
(
USB_EP3_NUM
);
Usb_select_endpoint
(
USB_EP3_NUM
);
Usb_enable_endpoint
();
usb_configure_endpoint
(
USB_EP3_NUM
,
USB_EP3_TYPE
,
USB_EP3_DIR
,
USB_EP3_SIZE
,
EP_ONE_BANK
,
EP_NYET_ENABLED
);
Usb_reset_endpoint
(
EP_CONTROL
);
Usb_reset_endpoint
(
USB_EP1_NUM
);
Usb_reset_endpoint
(
USB_EP2_NUM
);
Usb_reset_endpoint
(
USB_EP3_NUM
);
Usb_ack_reset
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment