Skip to content

Commit 28a20d5

Browse files
authored
Add volatile qualifier (FreeRTOS#1283)
Add volatile qualifier This is needed to ensure that the memory mapped address it always read. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 parent b3e6cff commit 28a20d5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[Oo]bj/
1212
[Ll]og/
1313
[Ll]ogs/
14+
[Bb]uild/
1415

1516
# CodeWarrior temporary files
1617
*.tdt

FreeRTOS/Demo/RISC-V-Qemu-virt_GCC/ns16550.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*
2222
* https://www.FreeRTOS.org
23-
* https://www.github.com/FreeRTOS
23+
* https://github.com/FreeRTOS
2424
*
2525
*/
2626

@@ -54,12 +54,12 @@
5454

5555
static uint8_t readb( uintptr_t addr )
5656
{
57-
return *( (uint8_t *) addr );
57+
return *( (volatile uint8_t *) addr );
5858
}
5959

6060
static void writeb( uint8_t b, uintptr_t addr )
6161
{
62-
*( (uint8_t *) addr ) = b;
62+
*( (volatile uint8_t *) addr ) = b;
6363
}
6464

6565
void vOutNS16550( struct device *dev, unsigned char c )

0 commit comments

Comments
 (0)