Improved FM modulation

tinySA
erikkaashoek 6 years ago
parent e1d24a2b98
commit 2981beb9a0

@ -467,7 +467,7 @@ void ili9341_read_memory(int x, int y, int w, int h, int len, uint16_t *out)
dmaStreamEnable(dmarx); dmaStreamEnable(dmarx);
// Wait DMA completion // Wait DMA completion
dmaWaitCompletion(dmatx); dmaWaitCompletion(dmatx);
#if 1 #if 0
int count = 0; int count = 0;
while ((dmarx)->channel->CNDTR > 0U) { while ((dmarx)->channel->CNDTR > 0U) {
chThdSleepMicroseconds(100); chThdSleepMicroseconds(100);
@ -477,7 +477,7 @@ void ili9341_read_memory(int x, int y, int w, int h, int len, uint16_t *out)
dmaStreamDisable(dmarx); dmaStreamDisable(dmarx);
#else #else
dmaWaitCompletion(dmarx); dmaWaitCompletion(dmarx);
#endif; #endif
chSysUnlock(); chSysUnlock();
CS_HIGH; CS_HIGH;

@ -709,9 +709,19 @@ float perform(bool break_on_operation, int i, int32_t f, int tracking)
chThdSleepMicroseconds(250); chThdSleepMicroseconds(250);
} else if (MODE_OUTPUT(setting_mode) && (setting_modulation == MO_NFM || setting_modulation == MO_WFM )) { } else if (MODE_OUTPUT(setting_mode) && (setting_modulation == MO_NFM || setting_modulation == MO_WFM )) {
SI4432_Sel = 1; SI4432_Sel = 1;
SI4432_Write_Byte(0x79, modulation_counter); // Use frequency hopping channel for FM modulation int offset;
if (modulation_counter == 3) if (setting_modulation == MO_NFM ) {
modulation_counter = 0; offset = modulation_counter ;
SI4432_Write_Byte(0x73, (offset & 0xff )); // Use frequency hopping channel for FM modulation
SI4432_Write_Byte(0x74, ((offset >> 8) & 0x03 )); // Use frequency hopping channel for FM modulation
}
else {
offset = modulation_counter * 100;
SI4432_Write_Byte(0x73, (offset & 0xff )); // Use frequency hopping channel for FM modulation
SI4432_Write_Byte(0x74, ((offset >> 8) & 0x03 )); // Use frequency hopping channel for FM modulation
}
if (modulation_counter == 2)
modulation_counter = -2;
else else
modulation_counter++; modulation_counter++;
chThdSleepMicroseconds(250); chThdSleepMicroseconds(250);

Loading…
Cancel
Save

Powered by TurnKey Linux.