2011-05-16 19:51:47 +02:00
2011-05-11 22:23:04 +02:00
2011-05-16 19:50:15 +02:00
2011-05-11 12:15:24 +02:00
2011-05-11 12:15:24 +02:00
2011-05-16 19:51:47 +02:00
2011-05-16 19:51:47 +02:00
2011-04-27 09:22:06 +02:00
2011-05-11 12:22:51 +02:00
2011-05-11 15:05:29 +02:00
2011-05-15 22:39:04 +02:00
2011-05-15 22:39:04 +02:00
2011-05-11 16:41:28 +02:00
2011-05-11 12:15:24 +02:00
2011-05-11 12:22:51 +02:00
2011-05-05 20:31:22 +02:00

This is alternative firmware for model radio FlySky FS-TH9X and clones.
This software comes with absolutely NO-WARRANTY.



It is programmed with using possibilities of hardware, using timers,
interrupts and cooperative multitasking (this is because it is much
simplier to program it then).




There are 2 interrupts:

ppm_interrupt
    - timer3 update interrupt
    - sets values for next servo channel to timer
    - wakeups task CALC during SYNC signal
timer_interrupt
    - timer2 overflow
    - every 5ms
    - increments time from start
    - count LCD blink time and wakeups task LCD
    - handles buzzer
    - wakeups task INPUT
    - handles task MENU delay and wakeups this task




There are 4 tasks:

LCD
    - is doing actual write to LCD controller
    - is waked up by lcd_update(), lcd_clear()
    - is waked up from timer to do automatic blinking
INPUT
    - is doing reading of ADC values and key matrix
    - is waked up from timer every 5ms
CALC
    - is computing values for each servo and sync signal
    - is waked up from ppm interrupt during sync signal generation
    - also nedded to wakeup after changing number of PPM channels in MENU
MENU
    - is main program handling keys, menus, lcd
    - is waked up from timer when menu_delay expired
    - is waked up from INPUT task when
	- buttons state changed
	- MENU task wanted ADC values (for calibrate) or battery voltage
	- status of battery low changed




Files:

stm8.h		- macros for STM8 handling
gt3b.h		- global common values

vector.c,h	- table of interrupt vectors
task.c,h	- cooperative multitasking
buzzer.c,h	- buzzer
eeprom.c,h	- eeprom read/write
timer.c,h	- timer 5ms
input.c,h	- INPUT task, reading ADC and keys
lcd.c,h		- LCD task, writing to LCD controller, blinking
ppm.c,h		- generating of PPM signal
config.c,h	- global and model configuration
main.c,h	- initialize all and call MENU task

menu.c,h	- MENU task, handling keys, menus, lcd
calc.c,h	- CALC task, calculate PPM values


Only last two files are used to implement what means what button
and how it changes signal for servos. Other files are sort of libraries
(or it can be viewed as a little operating system :-)

Description
No description provided
Readme 1.1 MiB
Languages
C 98.2%
Batchfile 1.1%
Shell 0.5%
Makefile 0.2%