Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Best way of storing state?

Posted by harrywright88 on March 16, 2016

Hi, I'm using FreeRTOS to write code for a music system and need to be able to save several states simultaneously (boot status, play status, source selected etc). Normally I would do this by having a global struct which contains several enums for each state. Is there a different/more appropriate way to accomplish saving states in FreeRTOS? I'm fairly new to the RTOS world, so excuse me if I've missed something obvious here. Many thanks


Best way of storing state?

Posted by rtel on March 16, 2016

I am an advocate of "the simplest way that works" - in this case the only reason not to continue to use the structure would be if multiple tasks need to write to the structure at the same time - in which case you would need to use some form of mutual exclusion primitive to ensure one task does not corrupt what another task is doing.


Best way of storing state?

Posted by harrywright88 on March 17, 2016

thanks for your response, I'll probably implement it as before, but with mutual exclusion.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS