From 84d2031e9684077d565492f80b6687d78bf68559 Mon Sep 17 00:00:00 2001 From: Christian Lind Madsen Date: Fri, 1 Nov 2024 21:56:00 +0100 Subject: [PATCH] commit.. some changes.. --- storno_cqp6xx_digital_xtal/avr_i2c_driver | 2 +- storno_cqp6xx_digital_xtal/cqm6xx_app.c | 42 +++++++++++++++++++++-- storno_cqp6xx_digital_xtal/cqm6xx_app.h | 16 ++++----- storno_cqp6xx_digital_xtal/main.c | 2 +- storno_cqp6xx_digital_xtal/si5351_driver | 2 +- 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/storno_cqp6xx_digital_xtal/avr_i2c_driver b/storno_cqp6xx_digital_xtal/avr_i2c_driver index c625fb3..a862662 160000 --- a/storno_cqp6xx_digital_xtal/avr_i2c_driver +++ b/storno_cqp6xx_digital_xtal/avr_i2c_driver @@ -1 +1 @@ -Subproject commit c625fb37b13b4949de289da86342ff423f9d57c5 +Subproject commit a8626628ef0008eda64073ec0afef1b9de6762c3 diff --git a/storno_cqp6xx_digital_xtal/cqm6xx_app.c b/storno_cqp6xx_digital_xtal/cqm6xx_app.c index 9196e51..34b4c33 100644 --- a/storno_cqp6xx_digital_xtal/cqm6xx_app.c +++ b/storno_cqp6xx_digital_xtal/cqm6xx_app.c @@ -2,11 +2,47 @@ * cqm6xx_app.c * * Created: 21-08-2024 21:12:36 - * Author: Chris + * Author: Christian Lind Vie Madsen - OZ1CM */ - -void storno_osc_app_init(){ +void cqm6xx_app_statemachine(storno_xtal_app *inst){ + + switch (inst->state_next) + { + case STORNO_APP_PROGRAM_OSC: + // Program PLL values here: + + // if ok, then go to RX mode: + inst->state_next = STORNO_APP_RX_MODE; + break; + + + case STORNO_APP_RX_MODE: + // If we just came from another state, then Enable RX osc here.. + + // If PTT is hold, then disable RX osc, and go to STORNO_APP_TX_MODE, to enable tx osc. + + break; + + case STORNO_APP_TX_MODE: + // If we just came from another state, then Enable TX osc here.. + + // If PTT is released, then disable TX osc, and go to STORNO_APP_RX_MODE, to enable rx osc. + break; + + case STORNO_APP_PROGRAM_OSC: + + break; + + case STORNO_APP_RST_TO_BOOTLOADER: + + break; + } +} +void cqm6xx_app_init(storno_xtal_app *inst){ + + inst->state_next = STORNO_APP_PROGRAM_OSC; + inst->state_now = STORNO_APP_PROGRAM_OSC; } \ No newline at end of file diff --git a/storno_cqp6xx_digital_xtal/cqm6xx_app.h b/storno_cqp6xx_digital_xtal/cqm6xx_app.h index 32ac06e..f965759 100644 --- a/storno_cqp6xx_digital_xtal/cqm6xx_app.h +++ b/storno_cqp6xx_digital_xtal/cqm6xx_app.h @@ -2,7 +2,7 @@ * cqm6xx_app.h * * Created: 21-08-2024 21:12:15 - * Author: Chris + * Author: Christian Lind Vie Madsen - OZ1CM */ @@ -11,14 +11,12 @@ typedef enum { - - STORNO_APP_INIT = 0, - STORNO_APP_START = 1, - STORNO_APP_PROGRAM_OSC = 2, - STORNO_APP_RX_MODE = 3, - STORNO_APP_TX_MODE = 4, - STORNO_APP_PROGRAM_MODE = 5, - STORNO_APP_RST_TO_BOOTLOADER = 6, + + STORNO_APP_PROGRAM_OSC = 0, + STORNO_APP_RX_MODE = 1, + STORNO_APP_TX_MODE = 2, + STORNO_APP_PROGRAM_MODE = 3, + STORNO_APP_RST_TO_BOOTLOADER = 4, }storno_app_states; diff --git a/storno_cqp6xx_digital_xtal/main.c b/storno_cqp6xx_digital_xtal/main.c index 43e94c3..3b0db77 100644 --- a/storno_cqp6xx_digital_xtal/main.c +++ b/storno_cqp6xx_digital_xtal/main.c @@ -2,7 +2,7 @@ * storno_cqp6xx_digital_xtal.c * * Created: 21-08-2024 20:28:13 - * Author : Chris + * Author : Christian Lind Vie Madsen - OZ1CM */ #include "avr_global_config.h" #include diff --git a/storno_cqp6xx_digital_xtal/si5351_driver b/storno_cqp6xx_digital_xtal/si5351_driver index 84b0b44..9f1436c 160000 --- a/storno_cqp6xx_digital_xtal/si5351_driver +++ b/storno_cqp6xx_digital_xtal/si5351_driver @@ -1 +1 @@ -Subproject commit 84b0b4489e821850102d4a12f895198befab4217 +Subproject commit 9f1436c1327ad28e2c9dacaa8f2b47097ef0a045