Fix OLED working on second core, add Traeger logo

This commit is contained in:
2022-06-27 23:47:22 -06:00
parent a7094c2f4c
commit 6a774d6c69
11 changed files with 159 additions and 29 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

4
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/traegerController.iml" filepath="$PROJECT_DIR$/.idea/traegerController.iml" />
</modules>
</component>
</project>

2
.idea/traegerController.iml generated Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

7
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/nina-fw" vcs="Git" />
</component>
</project>

View File

@@ -37,7 +37,7 @@ pico_sdk_init()
# Add executable. Default name is the project name, version 0.1
add_executable(traegerController traegerController.cpp )
add_executable(traegerController traegerController.cpp traegerLogo.h)
pico_set_program_name(traegerController "traegerController")
pico_set_program_version(traegerController "0.1")

5
picoprobe.cfg Normal file
View File

@@ -0,0 +1,5 @@
source [find interface/picoprobe.cfg]
transport select swd
adapter speed 5000
source [find target/rp2040.cfg]

View File

@@ -7,6 +7,8 @@
#include "hardware/i2c.h"
#include "hardware/timer.h"
#include "traegerLogo.h"
// SPI Defines
// We are going to use SPI 0, and allocate it to the following GPIO pins
// Pins can be changed, see the GPIO function select table in the datasheet for information on GPIO assignments
@@ -32,29 +34,11 @@ int64_t alarm_callback(alarm_id_t id, void *user_data) {
return 0;
}
void core1_entry()
[[noreturn]] void core1_entry()
{
}
int main()
{
stdio_init_all();
// SPI initialisation. This example will use SPI at 1MHz.
spi_init(SPI_PORT, 1000*1000);
gpio_set_function(PIN_MISO, GPIO_FUNC_SPI);
gpio_set_function(PIN_CS, GPIO_FUNC_SIO);
gpio_set_function(PIN_SCK, GPIO_FUNC_SPI);
gpio_set_function(PIN_MOSI, GPIO_FUNC_SPI);
// Chip select is active-low, so we'll initialise it to a driven-high state
gpio_set_dir(PIN_CS, GPIO_OUT);
gpio_put(PIN_CS, 1);
// I2C Initialisation. Using it at 400Khz.
i2c_init(I2C_PORT, 400*1000);
gpio_set_function(I2C_SDA, GPIO_FUNC_I2C);
gpio_set_function(I2C_SCL, GPIO_FUNC_I2C);
gpio_pull_up(I2C_SDA);
@@ -75,6 +59,12 @@ int main()
sleep_ms(1000);
display.setRotation(1);
display.clearDisplay();
display.drawBitmap(0, 0, logo, 128, 64, SH110X_WHITE);
display.display();
sleep_ms(1000);
display.clearDisplay();
display.display();
@@ -82,25 +72,46 @@ int main()
display.setTextSize(1);
display.setTextColor(SH110X_WHITE);
display.setCursor(0,0);
display.print("Hello from core 0!");
display.print("Hello! core 1\n");
display.display();
//multicore_launch_core1(core1_entry);
sleep_ms(1000);
display.setTextSize(2);
while(true)
{
if (gpio_get(BUTTON_A) == false) display.print("A\n");
if (gpio_get(BUTTON_B) == false) display.print("B\n");
if (gpio_get(BUTTON_C) == false) display.print("C\n");
display.clearDisplay();
display.setCursor(0,0);
display.print(!gpio_get(BUTTON_A) ? "A\n" : "\n");
display.print(!gpio_get(BUTTON_B) ? "B\n" : "\n");
display.print(!gpio_get(BUTTON_C) ? "C\n" : "\n");
display.display();
sleep_ms(250);
sleep_ms(100);
}
}
int main()
{
stdio_init_all();
// SPI initialisation. This example will use SPI at 1MHz.
spi_init(SPI_PORT, 1000*1000);
gpio_set_function(PIN_MISO, GPIO_FUNC_SPI);
gpio_set_function(PIN_CS, GPIO_FUNC_SIO);
gpio_set_function(PIN_SCK, GPIO_FUNC_SPI);
gpio_set_function(PIN_MOSI, GPIO_FUNC_SPI);
// Chip select is active-low, so we'll initialise it to a driven-high state
gpio_set_dir(PIN_CS, GPIO_OUT);
gpio_put(PIN_CS, 1);
multicore_launch_core1(core1_entry);
// Timer example code - This example fires off the callback after 2000ms
add_alarm_in_ms(2000, alarm_callback, NULL, false);
puts("Hello, world!");
return 0;
while(true) {
tight_loop_contents();
}
}

BIN
traegerLogo.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

84
traegerLogo.h Normal file
View File

@@ -0,0 +1,84 @@
//
// Created by Mikah Chapman on 6/27/22.
//
#ifndef TRAEGERCONTROLLER_TRAEGERLOGO_H
#define TRAEGERCONTROLLER_TRAEGERLOGO_H
/**
* Made with Marlin Bitmap Converter
* https://marlinfw.org/tools/u8glib/converter.html
*
* This bitmap from the file 'traegerLogo.bmp'
*/
#pragma once
#define LOGO_BMPWIDTH 128
const unsigned char logo[] = {
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B11000000,B00000000,B00000000,B00000000,B00100000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11110000,B00000000,B00000000,B00000000,B00110000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11111000,B00000000,B00000000,B00000000,B01110000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B00111100,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000110,B00000000,B00011100,B00001111,B00000000,B00000000,B00000000,B01111000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B10000000,B01111001,B10000011,B10000000,B00001000,B00000000,B11111000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00111101,B11100000,B11100111,B10000001,B11100000,B00111110,B00000000,B11111000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B11110000,B01111011,B11001111,B10000000,B01110001,B11100011,B10000000,B11111100,B00100000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000011,B11001100,B00011111,B00111111,B10000000,B00111111,B10011000,B11000000,B11111000,B01100000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00001111,B00111000,B00001110,B11111111,B00000000,B00011111,B11110000,B00110001,B11111100,B01100000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00111111,B11110000,B00111011,B11111111,B10000000,B00000111,B11110000,B00001000,B11111000,B01110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B11111111,B11110000,B01111111,B11111111,B11000000,B00000011,B11111000,B00000001,B11111110,B01110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000001,B11111111,B01100001,B11111111,B11111111,B10000000,B00000000,B11100000,B00000000,B11111100,B11110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000111,B11111110,B01000111,B11111110,B11111111,B10000000,B00000000,B01110000,B00000001,B11111110,B01110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00111111,B11111110,B00001111,B11111100,B11111111,B00000000,B00000000,B00011110,B00000010,B11111100,B11110000,B00000000,B00000000,
B00000000,B00000000,B00000001,B11111111,B11110000,B00111111,B11111001,B11001110,B00000000,B00000000,B00000111,B10000001,B11111100,B11111000,B00000000,B00000000,
B00000000,B00000000,B00011111,B11111110,B01100000,B11111111,B11110001,B10001100,B00000000,B00000000,B00000000,B11100000,B11111100,B11110000,B00000000,B00000000,
B00000000,B00000011,B11111111,B11110000,B01000011,B11111111,B11100011,B00011100,B00000000,B00000000,B00000000,B00011100,B10111001,B11111000,B00000000,B00000000,
B00000000,B00000000,B00000111,B00000000,B00001111,B11111111,B10000010,B00011000,B00000000,B00000000,B00000000,B00000011,B00110000,B11111000,B00000000,B00000000,
B00000000,B00000000,B00111000,B00000000,B01111111,B11111100,B00000000,B00010000,B00000000,B00000000,B00000000,B00000000,B00110000,B11110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000001,B11110011,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110100,B00100000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00001111,B00000111,B10000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01110001,B11100000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00110000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00011000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000010,B00000000,B00000000,B00000000,B00000000,B01111110,B01000000,B00000000,B00000000,B00000000,B00000000,
B11111111,B11111111,B00011111,B11111110,B00000000,B00000111,B00000000,B00111111,B11111110,B00000001,B11111111,B11100001,B11111111,B11110000,B11111111,B11110000,
B11100001,B11000011,B00001110,B00001111,B00000000,B00000111,B00000000,B00011100,B00000110,B00000111,B10000001,B11100000,B11100000,B00110000,B01110000,B01111100,
B11000001,B10000001,B00001110,B00000011,B10000000,B00001111,B00000000,B00011100,B00000110,B00001110,B00000000,B11100000,B11100000,B00110000,B01110000,B00011100,
B00000001,B10000000,B00001110,B00000011,B10000000,B00001111,B10000000,B00011100,B00000000,B00011100,B00000000,B01100000,B11100000,B00000000,B01110000,B00011100,
B00000001,B10000000,B00001110,B00000011,B10000000,B00011001,B10000000,B00011100,B00000000,B00011100,B00000000,B01000000,B11100000,B00000000,B01110000,B00011100,
B00000001,B10000000,B00001110,B00000011,B10000000,B00011001,B11000000,B00011100,B00000000,B00111000,B00000000,B00000000,B11100000,B00000000,B01110000,B00011100,
B00000001,B10000000,B00001110,B00000111,B00000000,B00010000,B11000000,B00011100,B00000000,B00111000,B00000000,B00000000,B11100000,B00000000,B01110000,B00111000,
B00000001,B10000000,B00001110,B00001110,B00000000,B00110000,B11100000,B00011100,B00001000,B00111000,B00000000,B00000000,B11100000,B01000000,B01110000,B01110000,
B00000001,B10000000,B00001111,B11111100,B00000000,B00110000,B01100000,B00011111,B11111000,B00111000,B00000000,B00000000,B11111111,B11000000,B01111111,B11100000,
B00000001,B10000000,B00001111,B11111100,B00000000,B01100000,B01110000,B00011100,B00001000,B00111000,B00000011,B11111000,B11100000,B01000000,B01111111,B11100000,
B00000001,B10000000,B00001110,B00011100,B00000000,B01111111,B11110000,B00011100,B00000000,B00111000,B00000000,B11100000,B11100000,B00000000,B01110000,B11100000,
B00000001,B10000000,B00001110,B00001110,B00000000,B11111111,B11111000,B00011100,B00000000,B00111000,B00000000,B11100000,B11100000,B00000000,B01110000,B01110000,
B00000001,B10000000,B00001110,B00000111,B00000000,B11000000,B00111000,B00011100,B00000000,B00111000,B00000000,B11100000,B11100000,B00000000,B01110000,B00111000,
B00000001,B10000000,B00001110,B00000111,B00000000,B11000000,B00111000,B00011100,B00000000,B00011100,B00000000,B11100000,B11100000,B00000000,B01110000,B00111000,
B00000001,B10000000,B00001110,B00000011,B10000001,B10000000,B00011100,B00011100,B00000001,B00011110,B00000000,B11100000,B11100000,B00001000,B01110000,B00011100,
B00000001,B10000000,B00001110,B00000011,B10000001,B10000000,B00011100,B00011100,B00000011,B00001111,B00000000,B11100000,B11100000,B00011000,B01110000,B00011100,
B00000011,B11000000,B00011111,B00000011,B11000111,B11000000,B00011110,B00111111,B11111111,B00000111,B11000011,B11000001,B11111111,B11111000,B11111000,B00011110,
B00000111,B11100000,B00011111,B00000111,B11100111,B11100000,B00111111,B00111111,B11111111,B00000001,B11111111,B00000001,B11111111,B11111000,B11111000,B00111111,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000
};
#endif //TRAEGERCONTROLLER_TRAEGERLOGO_H

1
traegerLogo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 74 KiB