Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit03672bb3ca928674ee336b7f5861cd5cb1b631d2 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-05-28 09:23:39 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-05-28 09:23:39 +0300
Filesbd6ce3c538bbb49c6e38bc1d0dfa30e899ed0378
uni-projects-03672bb3ca928674ee336b7f5861cd5cb1b631d2.tar
uni-projects-03672bb3ca928674ee336b7f5861cd5cb1b631d2.tar.gz
uni-projects-03672bb3ca928674ee336b7f5861cd5cb1b631d2.zip
Parentd82ab1114579f5561df1485f321f4ba50f30195e (diff)
[iot/goam] Added an icon for save/send setting
diff --git a/Year 3/Internet of things/goam/ibm-vga-8x16.xcf b/Year 3/Internet of things/goam/ibm-vga-8x16.xcf
index 4ecbb0e..1c2f439 100644
--- a/Year 3/Internet of things/goam/ibm-vga-8x16.xcf
+++ b/Year 3/Internet of things/goam/ibm-vga-8x16.xcf
Binary files differ
diff --git a/Year 3/Internet of things/goam/main/display.h b/Year 3/Internet of things/goam/main/display.h
index 7d56e5a..75a0012 100644
--- a/Year 3/Internet of things/goam/main/display.h
+++ b/Year 3/Internet of things/goam/main/display.h
@@ -14,8 +14,13 @@ void display_printat(const char* str, unsigned char line, unsigned char column);
#define LINE_CLEAR " "
+/* Single-width custom characters */
-/* Double-width characters */
+#define CHAR_IS_STORE_SEND "\14"
+#define CHAR_IS_SEND "\15"
+#define CHAR_IS_STORE "\16"
+
+/* Double-width custom characters */
#define DCHAR_CAMERA "\1\2"
#define DCHAR_NO_CAMERA "\3\4"
diff --git a/Year 3/Internet of things/goam/main/ibm-vga-8x16.c b/Year 3/Internet of things/goam/main/ibm-vga-8x16.c
index 2993a35..f4f491f 100644
--- a/Year 3/Internet of things/goam/main/ibm-vga-8x16.c
+++ b/Year 3/Internet of things/goam/main/ibm-vga-8x16.c
@@ -114,6 +114,37 @@ const uint8_t bitpixel_chars[256][16] = {
COL(0011011110110000)
},
+ ['\14'] = {
+ COL(0011000000000110)
+ COL(0010001000000011)
+ COL(0010011000110011)
+ COL(0010111110011011)
+ COL(0010011000110011)
+ COL(0010001000000011)
+ COL(0011000000000110)
+ COL(0000000000000000)
+ },
+ ['\15'] = {
+ COL(0011000000000110)
+ COL(0010000000000011)
+ COL(0010000000110011)
+ COL(0010000010011011)
+ COL(0010000000110011)
+ COL(0010000000000011)
+ COL(0011000000000110)
+ COL(0000000000000000)
+ },
+ ['\16'] = {
+ COL(0011000000000000)
+ COL(0010001000000000)
+ COL(0010011000000000)
+ COL(0010111110000000)
+ COL(0010011000000000)
+ COL(0010001000000000)
+ COL(0011000000000000)
+ COL(0000000000000000)
+ },
+
/* Standard characters */
[' '] = {
diff --git a/Year 3/Internet of things/goam/main/main.c b/Year 3/Internet of things/goam/main/main.c
index 8de110f..9ed0644 100644
--- a/Year 3/Internet of things/goam/main/main.c
+++ b/Year 3/Internet of things/goam/main/main.c
@@ -62,10 +62,19 @@ void print_chip_data() {
static int32_t is = BOTH;
+static void display_imagesave() {
+ switch (is) {
+ case SPIFFS_ONLY: display_printat(CHAR_IS_STORE, 1, 7); return;
+ case WS_ONLY: display_printat(CHAR_IS_SEND, 1, 7); return;
+ case BOTH: display_printat(CHAR_IS_STORE_SEND, 1, 7); return;
+ }
+}
+
void main_store_saveimage(int32_t value) {
if (value < 0 && value > BOTH) return;
nvs_write_i32("imagesave", value);
is = value;
+ display_imagesave();
}
/*
@@ -74,7 +83,7 @@ void main_store_saveimage(int32_t value) {
#define BTN_SHOOT_PIN 13
-void debug_serial_print_image(const char* image, size_t length) {
+static void debug_serial_print_image(const char* image, size_t length) {
for (int i = 0; i < length; i++) {
printf("%d ", image[i]);
if (i % 12 == 0)
@@ -83,7 +92,7 @@ void debug_serial_print_image(const char* image, size_t length) {
printf("\n");
}
-void take_photo() {
+static void take_photo() {
display_printon(DCHAR_NO_CAMERA, 1);
ptc06_set_image_resolution(RES_640X480);
@@ -110,7 +119,6 @@ static TaskHandle_t main_handle = NULL;
static void init_camera(void*) {
ptc06_init();
- nvs_read_i32("imagesave", &is);
if (xTaskNotify(main_handle, INIT_CAMERA_BIT, eSetBits) != pdPASS) {
ESP_LOGE(TAG, "Couldnt't notify main of camera init, software will hang");
@@ -139,6 +147,8 @@ void app_main(void)
display_init();
display_printon(DCHAR_NO_CAMERA, 1);
+ nvs_read_i32("imagesave", &is);
+ display_imagesave();
// This is really slow
wifi_init();