- Posts: 3333
Deviation v5.0.0 build with latest protocols
- vlad_vy
- Topic Author
- Offline
Goebish
(16.12.2016) Firmware DFU file only, you can get other components from official v5.0.0 release.
www.deviationtx.com/downloads-new/category/398-deviation-5-0-0
Files deleted, see below...
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
If I comment out TELEMETRY_SetTypeByProtocol at pages\common\_model_page.c, and change protocol, telemetry type do not changed up to:
1) reboot Tx
2) reload model
3) press Bind button
it's not convenient for model setup.
If I comment out TELEMETRY_SetTypeByProtocol at config\model.c, at first glance it's look like nothing changed.
I don't see sense to change anything with TELEMETRY_SetTypeByProtocol.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
victzh wrote: We really need to test dropping out the call to TELEMETRY_SetTypeByProtocol, it should work for everything except FrSky - they for some reason do not set the type themselves.
By the way, if I comment out TELEMETRY_SetTypeByProtocol at config\model.c, FrSky telemetry type not established at all. So, FrSky telemetry type established by reading modelXX.ini file only.
I think it's incorrect handling.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
So in the long term we better get rid of it leaving only setting of telemetry type from inside of the protocol. We better investigate why protocol is not being initialized upon being set on the page and when you leave this page. There should be call to protocol initialization, otherwise it is left in some strange state - model page shows you one thing and in reality another protocol is active. All other settings work this way - they become active as soon as set, only some rare pages have "Save" button.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
I think that the PB used this function no accidentally.
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Maybe it's time to reconsider some of these decisions - if you call protocol initialization earlier then it will set the telemetry type. I will look into it.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
char *ptr = (char *)loaded_protocol;
while(size < 4096) {
len = fread(buf, 1, 256, fh);
if(len) {
memcpy(ptr, buf, len);
ptr += len;
}
size += len;
if (len != 256)
break;
}
Nevertheless, targets for DevoF4, DevoF7 and DevoF12E have memory limit for modular protocols = 8K (protocol.ld):
MEMORY
{
ram (rwx) : ORIGIN = 0x20004000, LENGTH = 8K
}
Or I'm wrong?
Please Log in or Create an account to join the conversation.
- victzh
- Offline
- Posts: 1386
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Goebish
Devo7e excluded from these builds.
(18.12.2016) Firmware DFU file only, you can get other components from official v5.0.0 release.
www.deviationtx.com/downloads-new/category/398-deviation-5-0-0
Files deleted, see below...
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
void PROTOCOL_Load(int no_dlg)
{
....
if (PROTOCOL_GetTelemetryState() != PROTO_TELEM_UNSUPPORTED) {
memset(&Telemetry, 0, sizeof(Telemetry));
TELEMETRY_SetType(PROTOCOL_GetTelemetryType());
}
}
....
int PROTOCOL_GetTelemetryType()
{
int telem_type = TELEM_DEVO;
if(Model.protocol != PROTOCOL_NONE && PROTOCOL_LOADED)
telem_type = (long)PROTO_Cmds(PROTOCMD_TELEMETRYTYPE);
return telem_type;
}
case PROTOCMD_TELEMETRYSTATE:
return (void *)(long)(Model.proto_opts[PROTOOPTS_TELEMETRY] == TELEM_ON ? PROTO_TELEM_ON : PROTO_TELEM_OFF);
case PROTOCMD_TELEMETRYTYPE:
return (void *)(long) TELEM_DSM;
default: break;
So I'm not sure it's worth to do.
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
github.com/DeviationTX/deviation/pull/85/files
vladislavy
Standard Devo7e excluded from these builds.
(21.12.2016) Firmware DFU file only, you can get other components from official v5.0.0 release.
www.deviationtx.com/downloads-new/category/398-deviation-5-0-0
Files deleted, see below...
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
vladislavy
Devo7e with us again !!!
(23.12.2016) Firmware DFU file only, you can get other components from official v5.0.0 release.
www.deviationtx.com/downloads-new/category/398-deviation-5-0-0
Files deleted, see below...
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
EDIT for the Devo10
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
If it related to master branch "Nightly Builds", you can ask victzh, at 19-20 December he done many changes.
If it related to my "Deviation v5.0.0 build with latest protocols", I don't know, I change nothing related to Multimodule.
Please Log in or Create an account to join the conversation.
- SeByDocKy
- Offline
- Posts: 1016
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
Add Cheerson CX35 format to Q303 protocol, from goebish
(05.01.2017) Firmware DFU file only, you can get other components from official v5.0.0 release.
www.deviationtx.com/downloads-new/category/398-deviation-5-0-0
Files deleted, see below...
Please Log in or Create an account to join the conversation.
- vlad_vy
- Topic Author
- Offline
- Posts: 3333
at target\common\devo\sound.c in case the pause at music we have division by zero for "period" ({"xx", 0})
void SOUND_SetFrequency(unsigned frequency, unsigned volume)
{
if (volume == 0) {
//We need to keep the timer running (for the vibration motor, but also in case there is a pause in the music)
//But don't want the buzzer running
timer_disable_oc_output(_SOUND_TIM, _SOUND_TIM_OC);
} else {
timer_enable_oc_output(_SOUND_TIM, _SOUND_TIM_OC);
}
/* volume is between 0 and 100 */
/* period = 14400000 / frequency */
/* A Period of 65535 gives a ~ 220Hz tone */
/* The Devo buzzer reaches max-volume with a pw ~ 100us. That is max volume */
/* use quadratic to approximate exponential volume control */
u32 period = 14400000 / frequency;
/* Taylor series: x + x^2/2 + x^3/6 + x^4/24 */
u32 duty_cycle = (period >> 1) * (u32)volume / 100 * volume / 100 * volume / 100;
timer_set_period(_SOUND_TIM, period);
timer_set_oc_value(_SOUND_TIM, _SOUND_TIM_OC, duty_cycle);
}
so will be better to change code:
void SOUND_SetFrequency(unsigned frequency, unsigned volume)
{
if(frequency == 0) {
volume = 0;
frequency = 220;
}
if (volume == 0) {
//We need to keep the timer running (for the vibration motor, but also in case there is a pause in the music)
//But don't want the buzzer running
timer_disable_oc_output(_SOUND_TIM, _SOUND_TIM_OC);
} else {
timer_enable_oc_output(_SOUND_TIM, _SOUND_TIM_OC);
}
/* volume is between 0 and 100 */
/* period = 14400000 / frequency */
/* A Period of 65535 gives a ~ 220Hz tone */
/* The Devo buzzer reaches max-volume with a pw ~ 100us. That is max volume */
/* use quadratic to approximate exponential volume control */
u32 period = 14400000 / frequency;
/* Taylor series: x + x^2/2 + x^3/6 + x^4/24 */
u32 duty_cycle = (period >> 1) * (u32)volume / 100 * volume / 100 * volume / 100;
timer_set_period(_SOUND_TIM, period);
timer_set_oc_value(_SOUND_TIM, _SOUND_TIM_OC, duty_cycle);
}
and revert change at music.c:
static const struct NoteMap note_map[] = {
#ifdef EMULATOR
{"xx", 0}, // 10 Hz tone makes the emulator crash
#else
{"xx", 10}, // 0 Hz doesn't work well on actual hardware
#endif
{"a", 220}, {"ax", 233}, {"b", 247},
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Builds
- Deviation v5.0.0 build with latest protocols