Merge pull request #232 from F4FXL/bugfix/FM_CTCSS_TX

Fix invalid values passed to arm_sin_q15
This commit is contained in:
Jonathan Naylor 2020-04-26 08:16:20 +01:00 committed by GitHub
commit 1bc8726046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,8 @@ uint8_t CFMCTCSSTX::setParams(uint8_t frequency, uint8_t level)
m_values[i] = q15_t(__SSAT((value >> 15), 16));
arg += entry->increment;
if(arg < 0)//did we exceed max value of q15_t and flip over ?
arg += 32768;//bring arg back to valid values for ::arm_sin_q15, as per doc it needs to be in the range 0 to 0.99999999 (aka 0 - 32767)
}
return 0U;