summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-03-02 13:51:33 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-03-16 13:30:05 -0700
commit171916a4a37c369013849b1ebc597538504254f6 (patch)
treeb1f99744b72e65b6d4874c54427ddb5f2c706d98 /common
parentcf30d5c29dae458f1f616351b48f8d04aa4a777a (diff)
downloadchrome-ec-171916a4a37c369013849b1ebc597538504254f6.tar.gz
meowth_fp: move large buffers
Configure the large arrays for the image frame and template in other SRAM memory regions to free up space for the malloc heap in the 'main' SRAM. Note: the template buffer is only used in future CLs. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=on ZerbleBarn, run the 'shmem' console and see 500kB of heap available for malloc. Change-Id: I31a1b4fb0d5e124e3229d29386cc6500e402dac0 Reviewed-on: https://chromium-review.googlesource.com/946370 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/fpsensor.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/fpsensor.c b/common/fpsensor.c
index bf342f3cce..c465dd6963 100644
--- a/common/fpsensor.c
+++ b/common/fpsensor.c
@@ -10,6 +10,7 @@
#include "fpsensor.h"
#include "gpio.h"
#include "host_command.h"
+#include "link_defs.h"
#include "mkbp_event.h"
#include "spi.h"
#include "system.h"
@@ -27,8 +28,13 @@
#define FP_SENSOR_RES_Y 0
#endif
+/* if no special memory regions are defined, fallback on regular SRAM */
+#ifndef FP_FRAME_SECTION
+#define FP_FRAME_SECTION
+#endif
+
/* Last acquired frame */
-static uint8_t fp_buffer[FP_SENSOR_IMAGE_SIZE];
+static uint8_t fp_buffer[FP_SENSOR_IMAGE_SIZE] FP_FRAME_SECTION;
#define CPRINTF(format, args...) cprintf(CC_FP, format, ## args)
#define CPRINTS(format, args...) cprints(CC_FP, format, ## args)