Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit303d774212a4dd4e960a75774e9580b8ea7f597b (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-05-28 08:21:10 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-05-28 08:21:10 +0300
Filese4dac8fadbb12c80c4d9cb6ff0466864902b7a9e
uni-projects-303d774212a4dd4e960a75774e9580b8ea7f597b.tar
uni-projects-303d774212a4dd4e960a75774e9580b8ea7f597b.tar.gz
uni-projects-303d774212a4dd4e960a75774e9580b8ea7f597b.zip
Parent22dc9b47c73d6d663fbd747ec5d401f6ce2afee3 (diff)
[iot/goam] Added a camera warning icon when processing encounters ack error
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 41026bb..4ecbb0e 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 db1c339..7d56e5a 100644
--- a/Year 3/Internet of things/goam/main/display.h
+++ b/Year 3/Internet of things/goam/main/display.h
@@ -19,7 +19,8 @@ void display_printat(const char* str, unsigned char line, unsigned char column);
#define DCHAR_CAMERA "\1\2"
#define DCHAR_NO_CAMERA "\3\4"
+#define DCHAR_NO_CAMERA_EXCLAM "\3\5"
-#define DCHAR_WIFI "\5\6"
+#define DCHAR_WIFI "\6\7"
#define DCHAR_NO_WIFI "\10\11"
#define DCHAR_WIFI_EXCLAM "\12\13"
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 1df4772..2993a35 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
@@ -49,7 +49,18 @@ const uint8_t bitpixel_chars[256][16] = {
COL(0000000000000000)
},
- ['\5'] = { COL(0000000000110000)
+
+ ['\5'] = { COL(0000100110010000)
+ COL(0000100001000000)
+ COL(0000101101111110)
+ COL(0000101101111110)
+ COL(0000100000001000)
+ COL(0000111111110110)
+ COL(0000111111110010)
+ COL(0000000000000000)
+ },
+
+ ['\6'] = { COL(0000000000110000)
COL(0000000000011000)
COL(0000000000001100)
COL(0000000110000110)
@@ -57,7 +68,7 @@ const uint8_t bitpixel_chars[256][16] = {
COL(0000110001100110)
COL(0000011001100110)
COL(0011011001100110) },
- ['\6'] = { COL(0011011001100110)
+ ['\7'] = { COL(0011011001100110)
COL(0000011001100110)
COL(0000110001100110)
COL(0000000011000110)
diff --git a/Year 3/Internet of things/goam/main/ptc06.c b/Year 3/Internet of things/goam/main/ptc06.c
index a950011..ea345cd 100644
--- a/Year 3/Internet of things/goam/main/ptc06.c
+++ b/Year 3/Internet of things/goam/main/ptc06.c
@@ -5,6 +5,7 @@
/* #include "esp_check.h" */
#include "ptc06.h"
+#include "display.h"
#include <string.h>
/*
@@ -153,8 +154,11 @@ static void send(enum Command comm_byte, const char data_lengths, char data[16])
ESP_ERROR_CHECK(uart_wait_tx_done(UART_NUM, 100)); // if it takes too long, then we have communication issues
}
-#define byte_check(varname, compare) \
- if (!(compare)) ESP_LOGE(TAG, "Invalid response, " #varname);
+#define byte_check(errmsg, compare) \
+ if (!(compare)) { \
+ ESP_LOGE(TAG, "Invalid response, " errmsg); \
+ display_printon(DCHAR_NO_CAMERA_EXCLAM, 0); \
+ }
static void recv(enum Command comm_byte, const char expectedDataSize, char ack[21]) {
// Format:
@@ -164,10 +168,10 @@ static void recv(enum Command comm_byte, const char expectedDataSize, char ack[2
debug_print("recv", ack, 5+expectedDataSize);
- byte_check(BAD_RETURN_SIGN, ack[0] == 0x76);
- byte_check(BAD_SERIAL_NUM, ack[1] == serial_num);
- byte_check(BAD_RETURN_COMMAND, ack[2] == comm_byte);
- byte_check(BAD_RETURN_STATUS, ack[3] == 0);
+ byte_check("BAD_RETURN_SIGN", ack[0] == 0x76);
+ byte_check("BAD_SERIAL_NUM", ack[1] == serial_num);
+ byte_check("BAD_RETURN_COMMAND", ack[2] == comm_byte);
+ byte_check("BAD_RETURN_STATUS", ack[3] == 0);
// ack[4] is data-lengths, no need to check
}