Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
3da67d3d
Commit
3da67d3d
authored
11 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Patches
Plain Diff
Renaming to emphasize that the current bootloader mode is for Teensy boards only
parent
a98bca30
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
firmware/usb_dev.c
+5
-46
5 additions, 46 deletions
firmware/usb_dev.c
tools/teensy-bootloader-mode.py
+0
-0
0 additions, 0 deletions
tools/teensy-bootloader-mode.py
tools/usb-reboot.py
+0
-18
0 additions, 18 deletions
tools/usb-reboot.py
with
5 additions
and
64 deletions
firmware/usb_dev.c
+
5
−
46
View file @
3da67d3d
...
@@ -123,7 +123,7 @@ static uint8_t ep0_tx_data_toggle = 0;
...
@@ -123,7 +123,7 @@ static uint8_t ep0_tx_data_toggle = 0;
uint8_t
usb_rx_memory_needed
=
0
;
uint8_t
usb_rx_memory_needed
=
0
;
volatile
uint8_t
usb_configuration
=
0
;
volatile
uint8_t
usb_configuration
=
0
;
volatile
uint8_t
usb_reboot_timer
=
0
;
volatile
uint8_t
usb_
teensy_
reboot_timer
=
0
;
static
void
endpoint0_stall
(
void
)
static
void
endpoint0_stall
(
void
)
...
@@ -339,8 +339,8 @@ static void usb_setup(void)
...
@@ -339,8 +339,8 @@ static void usb_setup(void)
#endif
#endif
#ifdef USB_FADECANDY
#ifdef USB_FADECANDY
case
0x0140
:
// Reboot to bootloader
case
0x0140
:
// Reboot to
Teensy 3.0
bootloader
usb_reboot_timer
=
5
;
usb_
teensy_
reboot_timer
=
5
;
break
;
break
;
#endif
#endif
...
@@ -438,19 +438,6 @@ static void usb_control(uint32_t stat)
...
@@ -438,19 +438,6 @@ static void usb_control(uint32_t stat)
// first IN after Setup is always DATA1
// first IN after Setup is always DATA1
ep0_tx_data_toggle
=
1
;
ep0_tx_data_toggle
=
1
;
#if 0
serial_print("bmRequestType:");
serial_phex(setup.bmRequestType);
serial_print(", bRequest:");
serial_phex(setup.bRequest);
serial_print(", wValue:");
serial_phex16(setup.wValue);
serial_print(", wIndex:");
serial_phex16(setup.wIndex);
serial_print(", len:");
serial_phex16(setup.wLength);
serial_print("\n");
#endif
// actually "do" the setup request
// actually "do" the setup request
usb_setup
();
usb_setup
();
// unfreeze the USB, now that we're ready
// unfreeze the USB, now that we're ready
...
@@ -459,34 +446,6 @@ static void usb_control(uint32_t stat)
...
@@ -459,34 +446,6 @@ static void usb_control(uint32_t stat)
case
0x01
:
// OUT transaction received from host
case
0x01
:
// OUT transaction received from host
case
0x02
:
case
0x02
:
//serial_print("PID=OUT\n");
//serial_print("PID=OUT\n");
#ifdef CDC_STATUS_INTERFACE
if
(
setup
.
wRequestAndType
==
0x2021
/*CDC_SET_LINE_CODING*/
)
{
int
i
;
uint8_t
*
dst
=
(
uint8_t
*
)
usb_cdc_line_coding
;
//serial_print("set line coding ");
for
(
i
=
0
;
i
<
7
;
i
++
)
{
//serial_phex(*buf);
*
dst
++
=
*
buf
++
;
}
//serial_phex32(usb_cdc_line_coding[0]);
//serial_print("\n");
if
(
usb_cdc_line_coding
[
0
]
==
134
)
usb_reboot_timer
=
15
;
endpoint0_transmit
(
NULL
,
0
);
}
#endif
#ifdef KEYBOARD_INTERFACE
if
(
setup
.
word1
==
0x02000921
&&
setup
.
word2
==
((
1
<<
16
)
|
KEYBOARD_INTERFACE
))
{
keyboard_leds
=
buf
[
0
];
endpoint0_transmit
(
NULL
,
0
);
}
#endif
#ifdef SEREMU_INTERFACE
if
(
setup
.
word1
==
0x03000921
&&
setup
.
word2
==
((
4
<<
16
)
|
SEREMU_INTERFACE
)
&&
buf
[
0
]
==
0xA9
&&
buf
[
1
]
==
0x45
&&
buf
[
2
]
==
0xC2
&&
buf
[
3
]
==
0x6B
)
{
usb_reboot_timer
=
5
;
endpoint0_transmit
(
NULL
,
0
);
}
#endif
// give the buffer back
// give the buffer back
b
->
desc
=
BDT_DESC
(
EP0_SIZE
,
DATA1
);
b
->
desc
=
BDT_DESC
(
EP0_SIZE
,
DATA1
);
break
;
break
;
...
@@ -710,9 +669,9 @@ void usb_isr(void)
...
@@ -710,9 +669,9 @@ void usb_isr(void)
if
((
status
&
USB_INTEN_SOFTOKEN
/* 04 */
))
{
if
((
status
&
USB_INTEN_SOFTOKEN
/* 04 */
))
{
if
(
usb_configuration
)
{
if
(
usb_configuration
)
{
t
=
usb_reboot_timer
;
t
=
usb_
teensy_
reboot_timer
;
if
(
t
)
{
if
(
t
)
{
usb_reboot_timer
=
--
t
;
usb_
teensy_
reboot_timer
=
--
t
;
if
(
!
t
)
_reboot_Teensyduino_
();
if
(
!
t
)
_reboot_Teensyduino_
();
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
tools/
usb
-bootloader.py
→
tools/
teensy
-bootloader
-mode
.py
+
0
−
0
View file @
3da67d3d
File moved
This diff is collapsed.
Click to expand it.
tools/usb-reboot.py
deleted
100644 → 0
+
0
−
18
View file @
a98bca30
#!/usr/bin/env python
#
# Find a Fadecandy device, and ask it to reboot back to the Teensy bootloader.
#
# Micah Elizabeth Scott
# This example code is released into the public domain.
#
import
usb.core
dev
=
usb
.
core
.
find
(
idVendor
=
0x1d50
,
idProduct
=
0x607a
)
if
not
dev
:
raise
IOError
(
"
No Fadecandy interfaces found
"
)
dev
.
set_configuration
()
print
"
Serial number: %s
"
%
usb
.
util
.
get_string
(
dev
,
255
,
dev
.
iSerialNumber
)
dev
.
ctrl_transfer
(
0x40
,
1
)
print
"
Rebooted.
"
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