diff options
| author | Louis Burda <quent.burda@gmail.com> | 2024-11-09 00:56:31 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2024-11-09 00:56:31 +0100 |
| commit | 188b65034fa91ed692ef698602f005bece581272 (patch) | |
| tree | abbe81d033b1b085d8b0e15d3785ae06dba91233 | |
| parent | c0f8b7f02f08653953fd200d0676cdbad2b01ebc (diff) | |
| download | desk-andon-188b65034fa91ed692ef698602f005bece581272.tar.gz desk-andon-188b65034fa91ed692ef698602f005bece581272.zip | |
Add test mode
| -rw-r--r-- | docs/esp-hardware-design-guidelines-en-master-esp32c3.pdf | bin | 0 -> 1186190 bytes | |||
| -rw-r--r-- | firmware/notes | 8 | ||||
| -rw-r--r-- | firmware/src/main/main.c | 21 | ||||
| -rw-r--r-- | model/main.py | 7 |
4 files changed, 27 insertions, 9 deletions
diff --git a/docs/esp-hardware-design-guidelines-en-master-esp32c3.pdf b/docs/esp-hardware-design-guidelines-en-master-esp32c3.pdf Binary files differnew file mode 100644 index 0000000..025e319 --- /dev/null +++ b/docs/esp-hardware-design-guidelines-en-master-esp32c3.pdf diff --git a/firmware/notes b/firmware/notes index 3795e63..1296a35 100644 --- a/firmware/notes +++ b/firmware/notes @@ -1,9 +1,13 @@ V_GS,LOW = V_DD - (V_DD - V_CC - V_TVS) * (R2 / (R1 + R2)) V_GS,HIGH = V_DD - V_DD * (R2 / (R1 + R2)) -V_DD = 0.6 * (1 + R1 / R2) = 0.6 * (1 + 100 / 5.1) = 12.4 -V_GS,LOW = 12.4 - (12.4 - 5 - 0.7) * (100 / (100 + 10)) = 0.6 V +V_TVS ~= 6.3 V + +V_DD = 0.6 * (1 + R1 / R2) = 0.6 * (1 + 100 / 5.1) = 12.4 V +V_GS,LOW = 12.4 - ((12.4 - V_TVS) * (100 / (100 + 10)) + V_TVS) = 0.55 V V_GS,HIGH = 12.4 - 12.4 * (100 / (100 + 10)) = 1.13 V +V_GS,TH = 0.6-0.7 + Default stdio driver flushes after newline. May sleep for 50ms when the tx fifo is full, but generally unbuffered. diff --git a/firmware/src/main/main.c b/firmware/src/main/main.c index a9ed2d0..1324d9f 100644 --- a/firmware/src/main/main.c +++ b/firmware/src/main/main.c @@ -347,6 +347,19 @@ http_init(void) httpd_register_uri_handler(server, &http_post); } +static void +test_init(void) +{ + uint8_t bv = 0; + int tick = 0; + while (1) { + printf("Tick %i\n", ++tick); + set_output(1 << bv); + bv = (bv + 1) % (SPEAKER + 1); + vTaskDelay(TICKS_MS(1000)); + } +} + void app_main(void) { @@ -366,13 +379,11 @@ app_main(void) xTaskCreate(lcd_task_main, "lcd", 16 * 1024, NULL, tskIDLE_PRIORITY, &lcd_task); vTaskDelay(TICKS_MS(500)); + test_init(); + wifi_init(); http_init(); - int tick = 0; - while (1) { - printf("Tick %i\n", ++tick); - vTaskDelay(TICKS_MS(1000)); - } + while (1) vTaskDelay(1000); } diff --git a/model/main.py b/model/main.py index 54ea13d..8942110 100644 --- a/model/main.py +++ b/model/main.py @@ -263,6 +263,9 @@ def build_lid(base, rod, rod_shaft, wall, bolt, bolt_depth, tol, hole_spacing, else: part = part.cut(part_bolt.bounds.translate(bolt_pos)) part = part.cut(cylinder(bolt.radius + tol, bolt_depth + bolt.head_height).translate(bolt_pos)) + for r in range(0, 360, 90): + part = part.cut(box(outer.x, 8, 2).rotate(origin, (1, 0, 0), -45) + .translate((0, outer.x / 2, outer.z - 2)).rotate(origin, (0, 0, 1), r)) oled_pos = (oled_offset + V3(0, -outer_padded.y / 2, outer_padded.z - oled.outer.z)).xyz() part_oled = build_oled(**oled.__dict__) @@ -346,12 +349,12 @@ def main(): wall=thin_wall, bolt=bolt, bolt_depth=bolt_depth, tol=tol, hole_spacing=lid_hole_spacing, oled=oled, oled_offset=V3(0, 20, 0), antenna=antenna, antenna_offset=V3(-30, 20, 0), rod_support=rod_support) - #show_object(build_lid(**lid_ctx.__dict__).translate((0, 0, 50))) + show_object(build_lid(**lid_ctx.__dict__).translate((0, 0, 50))) base_ctx = V(base=base, rod=rod, rod_shaft=rod_shaft, bolt=bolt, wall=base_wall, tol=tol, usbc_board=usbc_board, board_space=board_space) - show_object(build_base(**base_ctx.__dict__, lid=lid_ctx)) + #show_object(build_base(**base_ctx.__dict__, lid=lid_ctx)) #show_object(build_oled(**oled.__dict__).bounds) |
