Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
82c7b1b1
Commit
82c7b1b1
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
stmhal: Put a USB structure in ROM; GC doesn't scan the data segment.
parent
b14f2a0b
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
stmhal/gccollect.c
+3
-4
3 additions, 4 deletions
stmhal/gccollect.c
stmhal/usb.c
+1
-1
1 addition, 1 deletion
stmhal/usb.c
stmhal/usbd_desc.h
+1
-2
1 addition, 2 deletions
stmhal/usbd_desc.h
stmhal/usbd_desc_cdc_msc.c
+1
-1
1 addition, 1 deletion
stmhal/usbd_desc_cdc_msc.c
with
6 additions
and
8 deletions
stmhal/gccollect.c
+
3
−
4
View file @
82c7b1b1
...
@@ -21,10 +21,9 @@ void gc_collect(void) {
...
@@ -21,10 +21,9 @@ void gc_collect(void) {
// start the GC
// start the GC
gc_collect_start
();
gc_collect_start
();
// scan everything in RAM before the heap
// We need to scan everything in RAM that can hold a pointer.
// this includes the data and bss segments
// The data segment is used, but should not contain pointers, so we just scan the bss.
// TODO possibly don't need to scan data, since all pointers should start out NULL and be in bss
gc_collect_root
((
void
**
)
&
_sbss
,
((
uint32_t
)
&
_ebss
-
(
uint32_t
)
&
_sbss
)
/
sizeof
(
uint32_t
));
gc_collect_root
((
void
**
)
&
_ram_start
,
((
uint32_t
)
&
_ebss
-
(
uint32_t
)
&
_ram_start
)
/
sizeof
(
uint32_t
));
// get the registers and the sp
// get the registers and the sp
machine_uint_t
regs
[
10
];
machine_uint_t
regs
[
10
];
...
...
This diff is collapsed.
Click to expand it.
stmhal/usb.c
+
1
−
1
View file @
82c7b1b1
...
@@ -28,7 +28,7 @@ void pyb_usb_dev_init(usb_device_mode_t mode, usb_storage_medium_t medium) {
...
@@ -28,7 +28,7 @@ void pyb_usb_dev_init(usb_device_mode_t mode, usb_storage_medium_t medium) {
}
else
{
}
else
{
USBD_SelectMode
(
USBD_MODE_CDC_HID
);
USBD_SelectMode
(
USBD_MODE_CDC_HID
);
}
}
USBD_Init
(
&
hUSBDDevice
,
&
VCP_Desc
,
0
);
USBD_Init
(
&
hUSBDDevice
,
(
USBD_DescriptorsTypeDef
*
)
&
VCP_Desc
,
0
);
USBD_RegisterClass
(
&
hUSBDDevice
,
&
USBD_CDC_MSC_HID
);
USBD_RegisterClass
(
&
hUSBDDevice
,
&
USBD_CDC_MSC_HID
);
USBD_CDC_RegisterInterface
(
&
hUSBDDevice
,
(
USBD_CDC_ItfTypeDef
*
)
&
USBD_CDC_fops
);
USBD_CDC_RegisterInterface
(
&
hUSBDDevice
,
(
USBD_CDC_ItfTypeDef
*
)
&
USBD_CDC_fops
);
#if MICROPY_HW_HAS_SDCARD
#if MICROPY_HW_HAS_SDCARD
...
...
This diff is collapsed.
Click to expand it.
stmhal/usbd_desc.h
+
1
−
2
View file @
82c7b1b1
extern
USBD_DescriptorsTypeDef
VCP_Desc
;
extern
const
USBD_DescriptorsTypeDef
VCP_Desc
;
extern
USBD_DescriptorsTypeDef
MSC_Desc
;
This diff is collapsed.
Click to expand it.
stmhal/usbd_desc_cdc_msc.c
+
1
−
1
View file @
82c7b1b1
...
@@ -59,7 +59,7 @@ uint8_t *USBD_VCP_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx, uint16_t
...
@@ -59,7 +59,7 @@ uint8_t *USBD_VCP_USRStringDesc (USBD_SpeedTypeDef speed, uint8_t idx, uint16_t
#endif
/* USB_SUPPORT_USER_STRING_DESC */
#endif
/* USB_SUPPORT_USER_STRING_DESC */
/* Private variables ---------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
USBD_DescriptorsTypeDef
VCP_Desc
=
{
const
USBD_DescriptorsTypeDef
VCP_Desc
=
{
USBD_VCP_DeviceDescriptor
,
USBD_VCP_DeviceDescriptor
,
USBD_VCP_LangIDStrDescriptor
,
USBD_VCP_LangIDStrDescriptor
,
USBD_VCP_ManufacturerStrDescriptor
,
USBD_VCP_ManufacturerStrDescriptor
,
...
...
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