diff options
author | David Barksdale <amatus@amatus.name> | 2016-04-16 14:26:59 -0500 |
---|---|---|
committer | David Barksdale <amatus@amatus.name> | 2016-04-16 14:26:59 -0500 |
commit | 6f00d1f8b977502615c93579b6d46a8699e3e214 (patch) | |
tree | c32356e9b33eb43b10175ca45f3f7cbb893d577c | |
parent | 0a25bcc2548c2949c2c8fe9e46b2499c39d5ee1f (diff) |
Added #define HAS_RESET for new vs old badges
V0 badges should define it as 0, newer badges with EPD RESET wired to
PTA19 should define it as 1.
-rw-r--r-- | laser-tag software/epaper.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/laser-tag software/epaper.c b/laser-tag software/epaper.c index 32427e5..bb1a132 100644 --- a/laser-tag software/epaper.c +++ b/laser-tag software/epaper.c @@ -2,6 +2,8 @@ #include "fsl_gpio_driver.h" #include "fsl_spi_dma_master_driver.h" +#define HAS_RESET 0 + typedef enum { /* Image pixel -> Display pixel */ EPD_compensate, /* B -> W, W -> B (Current Image) */ EPD_white, /* B -> N, W -> W (Current Image) */ @@ -11,12 +13,12 @@ typedef enum { /* Image pixel -> Display pixel */ static const gpio_output_pin_user_config_t pinReset = { .pinName = GPIO_MAKE_PIN(GPIOA_IDX, 19), - .config.outputLogic = 1, + .config.outputLogic = 0, }; static const gpio_output_pin_user_config_t pinCS = { .pinName = GPIO_MAKE_PIN(GPIOD_IDX, 4), - .config.outputLogic = 1, + .config.outputLogic = 0, }; static const spi_dma_master_user_config_t spiConfig = { @@ -196,10 +198,14 @@ void EPD_frame_repeat(const uint8_t *data, uint8_t fixed_value, EPD_stage stage) int EPD_Draw(const uint8_t *old_image, const uint8_t *new_image) { /* Reset */ +#if HAS_RESET GPIO_DRV_WritePinOutput(pinReset.pinName, 0); +#endif GPIO_DRV_WritePinOutput(pinCS.pinName, 0); EPD_Delay(5); +#if HAS_RESET GPIO_DRV_WritePinOutput(pinReset.pinName, 1); +#endif GPIO_DRV_WritePinOutput(pinCS.pinName, 1); EPD_Delay(5); |