diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-12-29 09:45:30 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-12-29 09:45:30 -0600 |
commit | bf86581950186b51e0db48f1177a38a0dd1af6fd (patch) | |
tree | 0479b30a35834e65d09852c01ad42bc119edd7e2 /nuttx | |
parent | 9176a7ae3fd642248d4791397de6db4fa8cc815d (diff) | |
download | nuttx-bf86581950186b51e0db48f1177a38a0dd1af6fd.tar.gz nuttx-bf86581950186b51e0db48f1177a38a0dd1af6fd.tar.bz2 nuttx-bf86581950186b51e0db48f1177a38a0dd1af6fd.zip |
stm32: fix faulty access to non existing layer. This disables operation that requires double layer support, when configured for single layer only.
Signed-off-by: Marco Krahl <ocram.lhark@gmail.com>
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_ltdc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_ltdc.c b/nuttx/arch/arm/src/stm32/stm32_ltdc.c index 52ec10181..b3663ba32 100644 --- a/nuttx/arch/arm/src/stm32/stm32_ltdc.c +++ b/nuttx/arch/arm/src/stm32/stm32_ltdc.c @@ -2906,8 +2906,10 @@ static int stm32_getarea(FAR struct ltdc_layer_s *layer, static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) { FAR struct stm32_layer_s *priv = (FAR struct stm32_layer_s *)layer; +#ifdef CONFIG_STM32_LTDC_L2 FAR struct stm32_layer_s *active = &LAYER(g_lactive); FAR struct stm32_layer_s *inactive = &LAYER(!g_lactive); +#endif gvdbg("layer = %p, mode = %08x\n", layer, mode); @@ -2932,6 +2934,11 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) stm32_ltdc_lupdate(priv); +#ifdef CONFIG_STM32_LTDC_L2 + /* The following operation only useful if layer 2 is supported. + * Otherwise ignore it. + */ + if (mode & LTDC_UPDATE_SIM) { /* Also update the flip layer */ @@ -2989,6 +2996,7 @@ static int stm32_update(FAR struct ltdc_layer_s *layer, uint32_t mode) g_lactive = inactive->state.lid; } +#endif /* Make the changes visible */ |