diff --git a/0x001aa_cb/0x001aa_cb.bin b/0x001aa_cb/0x001aa_cb.bin new file mode 100755 index 0000000..c1a5715 Binary files /dev/null and b/0x001aa_cb/0x001aa_cb.bin differ diff --git a/0x001aa_cb/0x001aa_cb.uf2 b/0x001aa_cb/0x001aa_cb.uf2 new file mode 100644 index 0000000..99be415 Binary files /dev/null and b/0x001aa_cb/0x001aa_cb.uf2 differ diff --git a/0x001aa_cb/CMakeLists.txt b/0x001aa_cb/CMakeLists.txt index 2610c77..25fa88b 100644 --- a/0x001aa_cb/CMakeLists.txt +++ b/0x001aa_cb/CMakeLists.txt @@ -1,11 +1,83 @@ +# MIT License +# +# Copyright (c) 2026 Kevin Thomas +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Author: Kevin Thomas +# Email: kevin@mytechnotalent.com +# GitHub: https://github.com/mytechnotalent +# File: CMakeLists.txt +# Desc: Configures RP2350 Pico SDK project for Operation Iron Net Firmware +# Created: 2026 + cmake_minimum_required(VERSION 3.13) + set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(WIN32) + set(USERHOME $ENV{USERPROFILE}) +else() + set(USERHOME $ENV{HOME}) +endif() +set(sdkVersion 2.2.0) +set(toolchainVersion 14_2_Rel1) +set(picotoolVersion 2.2.0-a4) +set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) +if (EXISTS ${picoVscode}) + include(${picoVscode}) +endif() + set(PICO_BOARD pico2 CACHE STRING "Board type") include(pico_sdk_import.cmake) -project(0x001aa_cb C CXX ASM) -pico_sdk_init() -add_executable(0x001aa_cb src/main.c) -target_link_libraries(0x001aa_cb pico_stdlib) +project(0x001aa_cb C CXX ASM) + +pico_sdk_init() + +add_executable(0x001aa_cb + src/main.c + src/dht11.c + src/logic.c +) + +pico_set_program_name(0x001aa_cb "0x001aa_cb") +pico_set_program_version(0x001aa_cb "0.1") + +pico_enable_stdio_uart(0x001aa_cb 1) +pico_enable_stdio_usb(0x001aa_cb 1) + +target_compile_definitions(0x001aa_cb PRIVATE + PICO_DEFAULT_UART_BAUD_RATE=115200 +) + +target_link_libraries(0x001aa_cb + pico_stdlib + hardware_gpio + hardware_uart + hardware_pwm +) + +target_include_directories(0x001aa_cb PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/include +) + +pico_add_extra_outputs(0x001aa_cb) diff --git a/0x001aa_cb/include/dht11.h b/0x001aa_cb/include/dht11.h new file mode 100644 index 0000000..c950a74 --- /dev/null +++ b/0x001aa_cb/include/dht11.h @@ -0,0 +1,23 @@ +/** + * @file dht11.h + * @brief Operation Iron Net Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef DHT11_H +#define DHT11_H +#include +typedef struct { + uint8_t humidity_int; + uint8_t humidity_dec; + uint8_t temp_int; + uint8_t temp_dec; + uint8_t checksum; +} dht11_data_t; +void dht11_init(void); +dht11_data_t* dht11_read(void); +#endif diff --git a/0x001aa_cb/include/logic.h b/0x001aa_cb/include/logic.h new file mode 100644 index 0000000..374e329 --- /dev/null +++ b/0x001aa_cb/include/logic.h @@ -0,0 +1,14 @@ +/** + * @file logic.h + * @brief Operation Iron Net Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef LOGIC_H +#define LOGIC_H +void evaluate_environment(void); +#endif diff --git a/0x001aa_cb/src/dht11.c b/0x001aa_cb/src/dht11.c new file mode 100644 index 0000000..a6cd1d1 --- /dev/null +++ b/0x001aa_cb/src/dht11.c @@ -0,0 +1,27 @@ +/** + * @file dht11.c + * @brief Operation Iron Net Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "dht11.h" +#include + +dht11_data_t current_reading; + +void dht11_init(void) { + current_reading.humidity_int = 45; + current_reading.humidity_dec = 0; + current_reading.temp_int = 22; + current_reading.temp_dec = 0; + current_reading.checksum = 0; +} + +dht11_data_t* dht11_read(void) { + // Simulated read + return ¤t_reading; +} diff --git a/0x001aa_cb/src/logic.c b/0x001aa_cb/src/logic.c new file mode 100644 index 0000000..e46150b --- /dev/null +++ b/0x001aa_cb/src/logic.c @@ -0,0 +1,36 @@ +/** + * @file logic.c + * @brief Operation Iron Net Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "logic.h" +#include "dht11.h" +#include +#include "pico/stdlib.h" +#include "hardware/gpio.h" + +#define PAYLOAD_GPIO 15 + +void __noinline evaluate_environment(void) { + dht11_data_t* reading = dht11_read(); + + // Complex bitwise checksum logic for students to reverse + uint8_t calculated = (reading->humidity_int ^ 0xAF) & 0x3C; + + if (calculated == 0x18) { + printf("[*] STRIKE AUTHORIZED. DEPLOYING PAYLOAD.\r\n"); + gpio_init(PAYLOAD_GPIO); + gpio_set_dir(PAYLOAD_GPIO, GPIO_OUT); + gpio_put(PAYLOAD_GPIO, 1); + sleep_ms(500); + gpio_put(PAYLOAD_GPIO, 0); + printf("[+] DEPLOYMENT SUCCESSFUL.\r\n"); + } else { + printf("[-] ENVIRONMENT SUB-OPTIMAL. HOLDING.\r\n"); + } +} diff --git a/0x001aa_cb/src/main.c b/0x001aa_cb/src/main.c index 27f8f2e..5e66b3b 100644 --- a/0x001aa_cb/src/main.c +++ b/0x001aa_cb/src/main.c @@ -1,25 +1,28 @@ +/** + * @file main.c + * @brief Operation Iron Net Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + #include #include "pico/stdlib.h" - -// Simulated DHT11 single-wire data -uint8_t current_humidity = 45; -uint8_t current_temp = 22; - -static void check_environmental_lock() { - // Complex bitwise checksum logic - uint8_t checksum = (current_humidity ^ 0xAF) & 0x3C; - - if (checksum == 0x18) { - printf("STRIKE AUTHORIZED.\r\n"); - } else { - printf("ENVIRONMENT SUB-OPTIMAL. HOLDING.\r\n"); - } -} +#include "dht11.h" +#include "logic.h" int main(void) { stdio_init_all(); + dht11_init(); + + sleep_ms(2000); + printf("SYSTEM BOOT: IRON NET SENSOR NODE ONLINE.\r\n"); + while (true) { - check_environmental_lock(); - sleep_ms(1000); + evaluate_environment(); + sleep_ms(1500); } + return 0; } diff --git a/0x001da_cb/0x001da_cb.bin b/0x001da_cb/0x001da_cb.bin new file mode 100755 index 0000000..84733b1 Binary files /dev/null and b/0x001da_cb/0x001da_cb.bin differ diff --git a/0x001da_cb/0x001da_cb.uf2 b/0x001da_cb/0x001da_cb.uf2 new file mode 100644 index 0000000..aa6004a Binary files /dev/null and b/0x001da_cb/0x001da_cb.uf2 differ diff --git a/0x001da_cb/CMakeLists.txt b/0x001da_cb/CMakeLists.txt index d33da13..46bc396 100644 --- a/0x001da_cb/CMakeLists.txt +++ b/0x001da_cb/CMakeLists.txt @@ -1,11 +1,83 @@ +# MIT License +# +# Copyright (c) 2026 Kevin Thomas +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Author: Kevin Thomas +# Email: kevin@mytechnotalent.com +# GitHub: https://github.com/mytechnotalent +# File: CMakeLists.txt +# Desc: Configures RP2350 Pico SDK project for Operation Broken Wing Firmware +# Created: 2026 + cmake_minimum_required(VERSION 3.13) + set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(WIN32) + set(USERHOME $ENV{USERPROFILE}) +else() + set(USERHOME $ENV{HOME}) +endif() +set(sdkVersion 2.2.0) +set(toolchainVersion 14_2_Rel1) +set(picotoolVersion 2.2.0-a4) +set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) +if (EXISTS ${picoVscode}) + include(${picoVscode}) +endif() + set(PICO_BOARD pico2 CACHE STRING "Board type") include(pico_sdk_import.cmake) -project(0x001da_cb C CXX ASM) -pico_sdk_init() -add_executable(0x001da_cb src/main.c) -target_link_libraries(0x001da_cb pico_stdlib) +project(0x001da_cb C CXX ASM) + +pico_sdk_init() + +add_executable(0x001da_cb + src/main.c + src/pwm_ctrl.c + src/state_machine.c +) + +pico_set_program_name(0x001da_cb "0x001da_cb") +pico_set_program_version(0x001da_cb "0.1") + +pico_enable_stdio_uart(0x001da_cb 1) +pico_enable_stdio_usb(0x001da_cb 1) + +target_compile_definitions(0x001da_cb PRIVATE + PICO_DEFAULT_UART_BAUD_RATE=115200 +) + +target_link_libraries(0x001da_cb + pico_stdlib + hardware_gpio + hardware_uart + hardware_pwm +) + +target_include_directories(0x001da_cb PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/include +) + +pico_add_extra_outputs(0x001da_cb) diff --git a/0x001da_cb/include/pwm_ctrl.h b/0x001da_cb/include/pwm_ctrl.h new file mode 100644 index 0000000..b035a89 --- /dev/null +++ b/0x001da_cb/include/pwm_ctrl.h @@ -0,0 +1,16 @@ +/** + * @file pwm_ctrl.h + * @brief Operation Broken Wing Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef PWM_CTRL_H +#define PWM_CTRL_H +void init_servo(void); +void deploy_payload(void); +void lock_payload(int altitude); +#endif diff --git a/0x001da_cb/include/state_machine.h b/0x001da_cb/include/state_machine.h new file mode 100644 index 0000000..a819862 --- /dev/null +++ b/0x001da_cb/include/state_machine.h @@ -0,0 +1,21 @@ +/** + * @file state_machine.h + * @brief Operation Broken Wing Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef STATE_MACHINE_H +#define STATE_MACHINE_H +#define STATE_IDLE 0 +#define STATE_ARMED 1 +typedef struct { + int current_state; + int current_altitude; +} drone_state_t; +extern drone_state_t drone; +void process_payload_state(void); +#endif diff --git a/0x001da_cb/src/main.c b/0x001da_cb/src/main.c index c2b93e4..4181d0c 100644 --- a/0x001da_cb/src/main.c +++ b/0x001da_cb/src/main.c @@ -1,25 +1,28 @@ +/** + * @file main.c + * @brief Operation Broken Wing Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + #include #include "pico/stdlib.h" - -#define STATE_IDLE 0 -#define STATE_ARMED 1 - -int current_state = STATE_ARMED; -int current_altitude = 0; // On the ground - -static void process_payload_state() { - if (current_state == STATE_ARMED && current_altitude > 500) { - printf("PWM ACTIVE: PAYLOAD DEPLOYED.\r\n"); - // Trigger SG90 Servo PWM here - } else { - printf("PWM LOCKED: SAFETY ENGAGED.\r\n"); - } -} +#include "pwm_ctrl.h" +#include "state_machine.h" int main(void) { stdio_init_all(); + init_servo(); + + sleep_ms(2000); + printf("SYSTEM BOOT: HEAVY LIFT UAS ONLINE.\r\n"); + while (true) { process_payload_state(); - sleep_ms(1000); + sleep_ms(2000); } + return 0; } diff --git a/0x001da_cb/src/pwm_ctrl.c b/0x001da_cb/src/pwm_ctrl.c new file mode 100644 index 0000000..9937505 --- /dev/null +++ b/0x001da_cb/src/pwm_ctrl.c @@ -0,0 +1,36 @@ +/** + * @file pwm_ctrl.c + * @brief Operation Broken Wing Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "pwm_ctrl.h" +#include "hardware/pwm.h" +#include "hardware/gpio.h" +#include + +#define SERVO_PIN 16 +static int pwm_slice = 0; + +void init_servo(void) { + gpio_set_function(SERVO_PIN, GPIO_FUNC_PWM); + pwm_slice = pwm_gpio_to_slice_num(SERVO_PIN); + pwm_set_wrap(pwm_slice, 39062); + pwm_set_clkdiv(pwm_slice, 64.0f); + pwm_set_enabled(pwm_slice, true); + pwm_set_gpio_level(SERVO_PIN, 0); +} + +void deploy_payload(void) { + printf("[*] PWM ACTIVE: PAYLOAD BAY DEPLOYED.\r\n"); + pwm_set_gpio_level(SERVO_PIN, 4000); +} + +void lock_payload(int altitude) { + printf("[-] ALTITUDE %d. PWM LOCKED: SAFETY ENGAGED.\r\n", altitude); + pwm_set_gpio_level(SERVO_PIN, 0); +} diff --git a/0x001da_cb/src/state_machine.c b/0x001da_cb/src/state_machine.c new file mode 100644 index 0000000..780a4ff --- /dev/null +++ b/0x001da_cb/src/state_machine.c @@ -0,0 +1,26 @@ +/** + * @file state_machine.c + * @brief Operation Broken Wing Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "state_machine.h" +#include "pwm_ctrl.h" +#include + +drone_state_t drone = { + .current_state = STATE_ARMED, + .current_altitude = 0, // Grounded +}; + +void __noinline process_payload_state(void) { + if (drone.current_state == STATE_ARMED && drone.current_altitude > 500) { + deploy_payload(); + } else { + lock_payload(drone.current_altitude); + } +} diff --git a/0x0020a_cb/0x0020a_cb.bin b/0x0020a_cb/0x0020a_cb.bin new file mode 100755 index 0000000..70c7ecc Binary files /dev/null and b/0x0020a_cb/0x0020a_cb.bin differ diff --git a/0x0020a_cb/0x0020a_cb.uf2 b/0x0020a_cb/0x0020a_cb.uf2 new file mode 100644 index 0000000..b07d274 Binary files /dev/null and b/0x0020a_cb/0x0020a_cb.uf2 differ diff --git a/0x0020a_cb/CMakeLists.txt b/0x0020a_cb/CMakeLists.txt index eceac19..c813ed9 100644 --- a/0x0020a_cb/CMakeLists.txt +++ b/0x0020a_cb/CMakeLists.txt @@ -1,11 +1,83 @@ +# MIT License +# +# Copyright (c) 2026 Kevin Thomas +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Author: Kevin Thomas +# Email: kevin@mytechnotalent.com +# GitHub: https://github.com/mytechnotalent +# File: CMakeLists.txt +# Desc: Configures RP2350 Pico SDK project for Operation Ghost Light Firmware +# Created: 2026 + cmake_minimum_required(VERSION 3.13) + set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +if(WIN32) + set(USERHOME $ENV{USERPROFILE}) +else() + set(USERHOME $ENV{HOME}) +endif() +set(sdkVersion 2.2.0) +set(toolchainVersion 14_2_Rel1) +set(picotoolVersion 2.2.0-a4) +set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) +if (EXISTS ${picoVscode}) + include(${picoVscode}) +endif() + set(PICO_BOARD pico2 CACHE STRING "Board type") include(pico_sdk_import.cmake) -project(0x0020a_cb C CXX ASM) -pico_sdk_init() -add_executable(0x0020a_cb src/main.c) -target_link_libraries(0x0020a_cb pico_stdlib) +project(0x0020a_cb C CXX ASM) + +pico_sdk_init() + +add_executable(0x0020a_cb + src/main.c + src/ir_rx.c + src/dazzler.c +) + +pico_set_program_name(0x0020a_cb "0x0020a_cb") +pico_set_program_version(0x0020a_cb "0.1") + +pico_enable_stdio_uart(0x0020a_cb 1) +pico_enable_stdio_usb(0x0020a_cb 1) + +target_compile_definitions(0x0020a_cb PRIVATE + PICO_DEFAULT_UART_BAUD_RATE=115200 +) + +target_link_libraries(0x0020a_cb + pico_stdlib + hardware_gpio + hardware_uart + hardware_pwm +) + +target_include_directories(0x0020a_cb PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/include +) + +pico_add_extra_outputs(0x0020a_cb) diff --git a/0x0020a_cb/include/dazzler.h b/0x0020a_cb/include/dazzler.h new file mode 100644 index 0000000..b8e61e0 --- /dev/null +++ b/0x0020a_cb/include/dazzler.h @@ -0,0 +1,22 @@ +/** + * @file dazzler.h + * @brief Operation Ghost Light Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef DAZZLER_H +#define DAZZLER_H +#include +#include +typedef struct { + uint32_t active_ir_code; + bool is_locked_out; +} dazzler_t; +extern dazzler_t laser_sys; +void dazzler_init(void); +void parse_nec_code(void); +#endif diff --git a/0x0020a_cb/include/ir_rx.h b/0x0020a_cb/include/ir_rx.h new file mode 100644 index 0000000..ac2d2b2 --- /dev/null +++ b/0x0020a_cb/include/ir_rx.h @@ -0,0 +1,15 @@ +/** + * @file ir_rx.h + * @brief Operation Ghost Light Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#ifndef IR_RX_H +#define IR_RX_H +#include +uint32_t get_latest_ir_code(void); +#endif diff --git a/0x0020a_cb/src/dazzler.c b/0x0020a_cb/src/dazzler.c new file mode 100644 index 0000000..8671540 --- /dev/null +++ b/0x0020a_cb/src/dazzler.c @@ -0,0 +1,46 @@ +/** + * @file dazzler.c + * @brief Operation Ghost Light Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "dazzler.h" +#include "ir_rx.h" +#include +#include "pico/stdlib.h" + +dazzler_t laser_sys; + +void dazzler_init(void) { + laser_sys.active_ir_code = 0x00FF00FF; + laser_sys.is_locked_out = false; +} + +void __noinline parse_nec_code(void) { + if (laser_sys.is_locked_out) { + printf("[!] SYSTEM LOCKED. REBOOT REQUIRED.\r\n"); + return; + } + + uint32_t code = get_latest_ir_code(); + + if (code == 0xFF0055AA) { + printf("[+] DAZZLER POWER LEVEL: MAX\r\n"); + } else if (code == 0xFF00AA55) { + printf("[+] DAZZLER TRACKING: ENGAGED\r\n"); + } else if (code == 0xFF0011EE) { + printf("[+] DAZZLER POWER LEVEL: LOW\r\n"); + } else if (code == 0xDEADBEEF) { + printf("[-] FRIENDLY FIRE LOCKOUT TRIGGERED. DAZZLER DISABLED.\r\n"); + laser_sys.is_locked_out = true; + while(1) { tight_loop_contents(); } + } else if (code == 0x00FF00FF) { + printf("[-] DAZZLER IDLE.\r\n"); + } else { + printf("[?] UNKNOWN IR COMMAND: 0x%08X\r\n", code); + } +} diff --git a/0x0020a_cb/src/ir_rx.c b/0x0020a_cb/src/ir_rx.c new file mode 100644 index 0000000..f583b5a --- /dev/null +++ b/0x0020a_cb/src/ir_rx.c @@ -0,0 +1,16 @@ +/** + * @file ir_rx.c + * @brief Operation Ghost Light Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + +#include "ir_rx.h" +uint32_t simulated_ir_rx_code = 0x00FF00FF; + +uint32_t get_latest_ir_code(void) { + return simulated_ir_rx_code; +} diff --git a/0x0020a_cb/src/main.c b/0x0020a_cb/src/main.c index e28d5d4..37133bf 100644 --- a/0x0020a_cb/src/main.c +++ b/0x0020a_cb/src/main.c @@ -1,25 +1,27 @@ +/** + * @file main.c + * @brief Operation Ghost Light Firmware + * @author Kevin Thomas + * @date 2026 + * + * MIT License + * Copyright (c) 2026 Kevin Thomas + */ + #include #include "pico/stdlib.h" - -uint32_t simulated_ir_rx_code = 0x00FF00FF; - -static void parse_nec_code(uint32_t code) { - if (code == 0xFF0055AA) { - printf("DAZZLER POWER LEVEL: MAX\r\n"); - } else if (code == 0xFF00AA55) { - printf("DAZZLER TRACKING: ENGAGED\r\n"); - } else if (code == 0xDEADBEEF) { - printf("FRIENDLY FIRE LOCKOUT TRIGGERED. DAZZLER DISABLED.\r\n"); - while(1); // Permanent lockout - } else { - printf("UNKNOWN IR COMMAND.\r\n"); - } -} +#include "dazzler.h" int main(void) { stdio_init_all(); + dazzler_init(); + + sleep_ms(2000); + printf("SYSTEM BOOT: GHOST LIGHT DAZZLER ONLINE.\r\n"); + while (true) { - parse_nec_code(simulated_ir_rx_code); - sleep_ms(1000); + parse_nec_code(); + sleep_ms(1500); } + return 0; }