Skip to content

Commit

Permalink
loading race issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 10, 2019
1 parent 7aff1c6 commit 81b0cda
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
6 changes: 5 additions & 1 deletion src/eez/gui/assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ uint8_t *g_fontsData;
uint8_t *g_bitmapsData;
Colors *g_colorsData;

bool g_assetsLoaded;

#if OPTION_SDRAM
void StyleList_fixPointers(StyleList &styleList) {
styleList.first = (Style *)((uint8_t *)g_styles + (uint32_t)styleList.first);
Expand Down Expand Up @@ -118,6 +120,8 @@ void decompressAssets() {
#if OPTION_SDRAM
fixPointers();
#endif

g_assetsLoaded = true;
}

const Style *getStyle(int styleID) {
Expand Down Expand Up @@ -194,4 +198,4 @@ const uint16_t *getColors() {
} // namespace gui
} // namespace eez

#endif
#endif
14 changes: 8 additions & 6 deletions src/eez/gui/assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ namespace eez {
namespace gui {

void decompressAssets();

extern Document *g_document;
extern StyleList *g_styles;
extern uint8_t *g_fontsData;
extern uint8_t *g_bitmapsData;
extern Colors *g_colorsData;

extern Document *g_document;
extern StyleList *g_styles;
extern uint8_t *g_fontsData;
extern uint8_t *g_bitmapsData;
extern Colors *g_colorsData;

extern bool g_assetsLoaded;

const Style *getStyle(int styleID);
const Style *getWidgetStyle(const Widget *widget);
Expand Down
10 changes: 6 additions & 4 deletions src/eez/modules/mcu/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ static uint32_t g_themeColorsCount;
static const uint16_t *g_colors;

void onThemeChanged() {
g_themeColors = getThemeColors(psu::persist_conf::devConf2.selectedThemeIndex);
g_themeColorsCount = getThemeColorsCount(psu::persist_conf::devConf2.selectedThemeIndex);
g_colors = getColors();
if (g_assetsLoaded) {
g_themeColors = getThemeColors(psu::persist_conf::devConf2.selectedThemeIndex);
g_themeColorsCount = getThemeColorsCount(psu::persist_conf::devConf2.selectedThemeIndex);
g_colors = getColors();
}
}

void onLuminocityChanged() {
Expand Down Expand Up @@ -357,4 +359,4 @@ void endBuffersDrawing() {
} // namespace mcu
} // namespace eez

#endif
#endif
2 changes: 1 addition & 1 deletion src/third_party/stm32_r1b5/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-936842781161742032" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.atollic.truestudio.mbs.GCCSpecsDetectorAtollicArm" console="false" env-hash="-1085687496758362492" id="com.atollic.truestudio.mbs.provider" keep-relative-paths="false" name="Atollic ARM Tools Language Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down

0 comments on commit 81b0cda

Please sign in to comment.