Skip to content

Commit 7bafce8

Browse files
committed
Update on 18 Jan 2023. Expand to see details.
4faab07a Remove internal deprecated files. d82f44a2 Upgrade to the latest Container Images. 04527692 Checked device removal while reading/writing storage. d7560786 Add a notice for not released file.
1 parent 2c66db9 commit 7bafce8

File tree

6 files changed

+108
-5
lines changed

6 files changed

+108
-5
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,53 @@ See [Overview of Azure RTOS USBX](https://learn.microsoft.com/azure/rtos/usbx/ov
3333

3434
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library. Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.2-rel`.
3535

36+
> When you see xx-xx-xxxx, 6.x or x.x in function header, this means the file is not officially released yet. They will be updated in the next release. See example below.
37+
```
38+
/**************************************************************************/
39+
/* */
40+
/* FUNCTION RELEASE */
41+
/* */
42+
/* _tx_initialize_low_level Cortex-M23/GNU */
43+
/* 6.x */
44+
/* AUTHOR */
45+
/* */
46+
/* Scott Larson, Microsoft Corporation */
47+
/* */
48+
/* DESCRIPTION */
49+
/* */
50+
/* This function is responsible for any low-level processor */
51+
/* initialization, including setting up interrupt vectors, setting */
52+
/* up a periodic timer interrupt source, saving the system stack */
53+
/* pointer for use in ISR processing later, and finding the first */
54+
/* available RAM memory address for tx_application_define. */
55+
/* */
56+
/* INPUT */
57+
/* */
58+
/* None */
59+
/* */
60+
/* OUTPUT */
61+
/* */
62+
/* None */
63+
/* */
64+
/* CALLS */
65+
/* */
66+
/* None */
67+
/* */
68+
/* CALLED BY */
69+
/* */
70+
/* _tx_initialize_kernel_enter ThreadX entry function */
71+
/* */
72+
/* RELEASE HISTORY */
73+
/* */
74+
/* DATE NAME DESCRIPTION */
75+
/* */
76+
/* 09-30-2020 Scott Larson Initial Version 6.1 */
77+
/* xx-xx-xxxx Scott Larson Include tx_user.h, */
78+
/* resulting in version 6.x */
79+
/* */
80+
/**************************************************************************/
81+
```
82+
3683
## Component dependencies
3784

3885
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them, as shown in the following graph. This is important to understand when setting up your builds.

common/usbx_host_classes/src/ux_host_class_storage_check_run.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/* FUNCTION RELEASE */
3737
/* */
3838
/* _ux_host_class_storage_check_run PORTABLE C */
39-
/* 6.1.10 */
39+
/* 6.x */
4040
/* AUTHOR */
4141
/* */
4242
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -79,10 +79,14 @@
7979
/* DATE NAME DESCRIPTION */
8080
/* */
8181
/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
82+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
83+
/* checked device state, */
84+
/* resulting in version 6.x */
8285
/* */
8386
/**************************************************************************/
8487
UINT _ux_host_class_storage_check_run(UX_HOST_CLASS_STORAGE *storage)
8588
{
89+
UX_DEVICE *device;
8690

8791
#if defined UX_HOST_CLASS_STORAGE_STATE_CHECK_ENABLE
8892
UX_INTERRUPT_SAVE_AREA
@@ -107,6 +111,9 @@ UX_INTERRUPT_SAVE_AREA
107111
UX_RESTORE
108112
#endif
109113

114+
/* Get device. */
115+
device = storage -> ux_host_class_storage_device;
116+
110117
switch(storage -> ux_host_class_storage_op_state)
111118
{
112119
case UX_STATE_IDLE:
@@ -130,6 +137,14 @@ UX_INTERRUPT_SAVE_AREA
130137
/* Run tasks, including transport task. */
131138
_ux_system_host_tasks_run();
132139

140+
/* Check if device is still available. */
141+
if (device -> ux_device_state != UX_DEVICE_CONFIGURED)
142+
{
143+
144+
/* Instance should have been destroyed, just return. */
145+
return(UX_STATE_EXIT);
146+
}
147+
133148
/* In case state is not idle, check if it changes back. */
134149
if (storage -> ux_host_class_storage_state_state == UX_STATE_IDLE)
135150
{

common/usbx_host_classes/src/ux_host_class_storage_lock.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/* FUNCTION RELEASE */
3737
/* */
3838
/* _ux_host_class_storage_lock PORTABLE C */
39-
/* 6.1.10 */
39+
/* 6.x */
4040
/* AUTHOR */
4141
/* */
4242
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -71,12 +71,19 @@
7171
/* DATE NAME DESCRIPTION */
7272
/* */
7373
/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
74+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
75+
/* checked device state, */
76+
/* resulting in version 6.x */
7477
/* */
7578
/**************************************************************************/
7679
UINT _ux_host_class_storage_lock(UX_HOST_CLASS_STORAGE *storage, ULONG wait)
7780
{
7881
UX_INTERRUPT_SAVE_AREA
7982
ULONG t0, t1;
83+
UX_DEVICE *device;
84+
85+
/* Get device. */
86+
device = storage -> ux_host_class_storage_device;
8087

8188
t0 = _ux_utility_time_get();
8289
while(1)
@@ -129,6 +136,14 @@ ULONG t0, t1;
129136

130137
/* Run stack tasks. */
131138
_ux_system_host_tasks_run();
139+
140+
/* Check if device is still available. */
141+
if (device -> ux_device_state != UX_DEVICE_CONFIGURED)
142+
{
143+
144+
/* Instance should have been destroyed, just return. */
145+
return(UX_STATE_EXIT);
146+
}
132147
}
133148

134149
/* Lock storage. */

common/usbx_host_classes/src/ux_host_class_storage_media_read.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ULONG command_length;
8282
/* FUNCTION RELEASE */
8383
/* */
8484
/* _ux_host_class_storage_media_read PORTABLE C */
85-
/* 6.1.10 */
85+
/* 6.x */
8686
/* AUTHOR */
8787
/* */
8888
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -123,6 +123,9 @@ ULONG command_length;
123123
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
124124
/* added standalone support, */
125125
/* resulting in version 6.1.10 */
126+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
127+
/* checked device removal, */
128+
/* resulting in version 6.x */
126129
/* */
127130
/**************************************************************************/
128131
UINT _ux_host_class_storage_media_read(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
@@ -134,6 +137,8 @@ UINT status;
134137
status = _ux_host_class_storage_read_write_run(storage, UX_TRUE,
135138
sector_start, sector_count, data_pointer);
136139
} while(status == UX_STATE_WAIT);
140+
if (status < UX_STATE_IDLE)
141+
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
137142
return(storage -> ux_host_class_storage_status);
138143
#else
139144
UINT status;

common/usbx_host_classes/src/ux_host_class_storage_media_write.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ULONG command_length;
8181
/* FUNCTION RELEASE */
8282
/* */
8383
/* _ux_host_class_storage_media_write PORTABLE C */
84-
/* 6.1.10 */
84+
/* 6.x */
8585
/* AUTHOR */
8686
/* */
8787
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -122,6 +122,9 @@ ULONG command_length;
122122
/* 01-31-2022 Chaoqiong Xiao Modified comment(s), */
123123
/* added standalone support, */
124124
/* resulting in version 6.1.10 */
125+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
126+
/* checked device removal, */
127+
/* resulting in version 6.x */
125128
/* */
126129
/**************************************************************************/
127130
UINT _ux_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start,
@@ -133,6 +136,8 @@ UINT status;
133136
status = _ux_host_class_storage_read_write_run(storage, UX_FALSE,
134137
sector_start, sector_count, data_pointer);
135138
} while(status == UX_STATE_WAIT);
139+
if (status < UX_STATE_IDLE)
140+
return(UX_HOST_CLASS_INSTANCE_UNKNOWN);
136141
return(storage -> ux_host_class_storage_status);
137142
#else
138143
UINT status;

common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern VOID _ux_host_class_storage_write_initialize(UX_HOST_CLASS_STORAGE *stora
4343
/* FUNCTION RELEASE */
4444
/* */
4545
/* _ux_host_class_storage_read_write_run PORTABLE C */
46-
/* 6.1.10 */
46+
/* 6.x */
4747
/* AUTHOR */
4848
/* */
4949
/* Chaoqiong Xiao, Microsoft Corporation */
@@ -93,13 +93,18 @@ extern VOID _ux_host_class_storage_write_initialize(UX_HOST_CLASS_STORAGE *stora
9393
/* DATE NAME DESCRIPTION */
9494
/* */
9595
/* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */
96+
/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */
97+
/* checked device state, */
98+
/* resulting in version 6.x */
9699
/* */
97100
/**************************************************************************/
98101
UINT _ux_host_class_storage_read_write_run(UX_HOST_CLASS_STORAGE *storage,
99102
ULONG read_write,
100103
ULONG sector_start, ULONG sector_count, UCHAR *data_pointer)
101104
{
102105

106+
UX_DEVICE *device;
107+
103108
#if defined UX_HOST_CLASS_STORAGE_STATE_CHECK_ENABLE
104109
UX_INTERRUPT_SAVE_AREA
105110

@@ -125,6 +130,9 @@ UX_INTERRUPT_SAVE_AREA
125130
/* If trace is enabled, insert this event into the trace buffer. */
126131
UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_STORAGE_MEDIA_READ, storage, sector_start, sector_count, data_pointer, UX_TRACE_HOST_CLASS_EVENTS, 0, 0)
127132

133+
/* Get device. */
134+
device = storage -> ux_host_class_storage_device;
135+
128136
switch(storage -> ux_host_class_storage_op_state)
129137
{
130138
case UX_STATE_IDLE: /* Fall through. */
@@ -150,6 +158,14 @@ UX_INTERRUPT_SAVE_AREA
150158
/* Run tasks, including transport task. */
151159
_ux_system_host_tasks_run();
152160

161+
/* Check if device is still available. */
162+
if (device -> ux_device_state != UX_DEVICE_CONFIGURED)
163+
{
164+
165+
/* Instance should have been destroyed, just return. */
166+
return(UX_STATE_EXIT);
167+
}
168+
153169
/* Fatal error. */
154170
if (storage -> ux_host_class_storage_op_state < UX_STATE_IDLE)
155171
return(UX_STATE_EXIT);

0 commit comments

Comments
 (0)