-
Hi all. The following function is for the Text to CW encoding and Tone generation.
But since I used SYSTEM_DelayMs(), everything just freezes until the tx finishes. I've seen some countdowns used at the backlight auto off function, and i have no idea how. Basically my main goal is to run this but making it interruptable or as a background process. Here is my forked repo: jason8098/uv-k5-firmware-custom-with-cw Thanks in advance 73s |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello 😉 I've moved your issue to the Discussions section, as the problem you're reporting doesn't appear to be related to my firmware, but rather to your own development. I'll take a look if I get the chance, but others in the community might be able to help you in the meantime. Have a nice day. Armel, F4HWN |
Beta Was this translation helpful? Give feedback.
-
So I figured it out: Basically, I saw a count down going on when you hold PTT and I was wondering if I could make other countdown for the morse code function. So I asked chatgpt to make one and it worked! The details are: First I added this set of countdown variable and the reached variable at misc.c : volatile uint16_t gCustomCountdown_10ms = 0;
volatile bool gCustomTimeoutReached = false; Then I added additional decrement function in the scheduler.c : void SystickHandler(void)
{
.... //rest of the codes
DECREMENT_AND_TRIGGER(gCustomCountdown_10ms, gCustomTimeoutReached);
} This will basically make decrements to the gCustomCountdown_10ms then trigger the gCustomTimeoutReached into true when the countdown is finished. Then I made new delay function using that and replaced instead of SYSTEM_DelayMs(): void morseDelay(uint16_t tms){
gCustomCountdown_10ms = tms/10;
gCustomTimeoutReached = false;
while (!gCustomTimeoutReached) {
if (KEYBOARD_Poll() == KEY_EXIT) {
txstatus=0;
txen=false;
isHalted=1;
}
if(txstatus==0){
return;
}
}
} Since the counter makes decrements every 10ms, it devides input which is in ms by 10. I am not sure if there's more efficient way but it's fine as long as it works haha. TODO: make it configurable by chirp or in radio menu.... (have to mess up with the eeprom) 73s to Everyone! |
Beta Was this translation helpful? Give feedback.
So I figured it out:
Basically, I saw a count down going on when you hold PTT and I was wondering if I could make other countdown for the morse code function. So I asked chatgpt to make one and it worked!
The details are:
First I added this set of countdown variable and the reached variable at misc.c :
Then I added additional decrement function in the scheduler.c :
This will basically make decrements to the gCustomCountdown_10ms then trigger the gCustomTimeoutReached into…