summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2019-12-02 18:42:10 (GMT)
committerJF <jf@codingfield.com>2019-12-02 18:42:10 (GMT)
commit66182d15bca7e88aaceee9bb4cc03218a4f24569 (patch)
treec99bcdade207963574634922f148ebd08cbde1f1 /src/main.cpp
parent2ea27e0cdac91cd4743d9f12496bb3f911d9efa9 (diff)
First code tested on the actual pinetime hardware
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9ce22d3..c04cc84 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,6 +7,8 @@
#include <legacy/nrf_drv_clock.h>
#include <libraries/timer/app_timer.h>
#include <libraries/gpiote/app_gpiote.h>
+#include <libraries/gfx/nrf_lcd.h>
+#include "nrf_gfx.h"
#if NRF_LOG_ENABLED
@@ -43,6 +45,25 @@ static void bsp_event_handler(bsp_event_t event)
}
}
+extern const nrf_lcd_t nrf_lcd_st7735;
+static nrf_lcd_t const * p_lcd = &nrf_lcd_st7735;
+static void gfx_initialization(void)
+{
+ nrf_gpio_cfg_output(14);
+ nrf_gpio_cfg_output(22);
+ nrf_gpio_cfg_output(23);
+ nrf_gpio_pin_clear(14);
+ nrf_gpio_pin_set(22);
+ nrf_gpio_pin_set(23);
+
+ APP_ERROR_CHECK(nrf_gfx_init(p_lcd));
+ nrf_gfx_rect_t rect;
+ rect.height = 10;
+ rect.width = 10;
+ rect.x = 10;
+ rect.y = 10;
+ nrf_gfx_rect_draw(p_lcd, &rect, 2, 0xffffffff, true);
+}
void SystemTask(void *) {
APP_GPIOTE_INIT(2);
@@ -51,6 +72,9 @@ void SystemTask(void *) {
bsp_board_init(BSP_INIT_LEDS|BSP_INIT_BUTTONS);
bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler);
+ gfx_initialization();
+
+
blinkApp.Start();
while (1) {
@@ -58,6 +82,8 @@ void SystemTask(void *) {
}
}
+
+
int main(void) {
logger.Init();
nrf_drv_clock_init();