[SSTV] Fixes from cppcheck scan

pull/163/head
jgromes 2020-07-04 13:18:24 +02:00
rodzic b67060e424
commit be585bbf78
2 zmienionych plików z 10 dodań i 14 usunięć

Wyświetl plik

@ -166,7 +166,7 @@ SSTVClient::SSTVClient(AFSKClient* audio) {
} }
#endif #endif
int16_t SSTVClient::begin(SSTVMode_t mode, float correction) { int16_t SSTVClient::begin(const SSTVMode_t& mode, float correction) {
if(_audio == nullptr) { if(_audio == nullptr) {
// this initialization method can only be used in AFSK mode // this initialization method can only be used in AFSK mode
return(ERR_WRONG_MODEM); return(ERR_WRONG_MODEM);
@ -175,7 +175,7 @@ int16_t SSTVClient::begin(SSTVMode_t mode, float correction) {
return(begin(0, mode, correction)); return(begin(0, mode, correction));
} }
int16_t SSTVClient::begin(float base, SSTVMode_t mode, float correction) { int16_t SSTVClient::begin(float base, const SSTVMode_t& mode, float correction) {
// save mode // save mode
_mode = mode; _mode = mode;
@ -278,10 +278,6 @@ void SSTVClient::sendLine(uint32_t* imgLine) {
} }
} }
uint16_t SSTVClient::getPictureHeight() {
return(_mode.height);
}
void SSTVClient::tone(float freq, uint32_t len) { void SSTVClient::tone(float freq, uint32_t len) {
uint32_t start = micros(); uint32_t start = micros();
if(_audio != nullptr) { if(_audio != nullptr) {

Wyświetl plik

@ -121,7 +121,7 @@ class SSTVClient {
\param phy Pointer to the wireless module providing PhysicalLayer communication. \param phy Pointer to the wireless module providing PhysicalLayer communication.
*/ */
SSTVClient(PhysicalLayer* phy); explicit SSTVClient(PhysicalLayer* phy);
#if !defined(RADIOLIB_EXCLUDE_AFSK) #if !defined(RADIOLIB_EXCLUDE_AFSK)
/*! /*!
@ -129,7 +129,7 @@ class SSTVClient {
\param audio Pointer to the AFSK instance providing audio. \param audio Pointer to the AFSK instance providing audio.
*/ */
SSTVClient(AFSKClient* phy); explicit SSTVClient(AFSKClient* audio);
#endif #endif
// basic methods // basic methods
@ -145,7 +145,7 @@ class SSTVClient {
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t begin(float base, SSTVMode_t mode, float correction = 1.0); int16_t begin(float base, const SSTVMode_t& mode, float correction = 1.0);
/*! /*!
\brief Initialization method for AFSK. \brief Initialization method for AFSK.
@ -156,7 +156,7 @@ class SSTVClient {
\returns \ref status_codes \returns \ref status_codes
*/ */
int16_t begin(SSTVMode_t mode, float correction = 1.0); int16_t begin(const SSTVMode_t& mode, float correction = 1.0);
/*! /*!
\brief Sends out tone at 1900 Hz. \brief Sends out tone at 1900 Hz.
@ -180,7 +180,7 @@ class SSTVClient {
\returns Picture height of the currently configured SSTV mode in pixels. \returns Picture height of the currently configured SSTV mode in pixels.
*/ */
uint16_t getPictureHeight(); uint16_t getPictureHeight() const { return(_mode.height); };
#ifndef RADIOLIB_GODMODE #ifndef RADIOLIB_GODMODE
private: private:
@ -192,9 +192,9 @@ class SSTVClient {
void* _audio; void* _audio;
#endif #endif
uint32_t _base; uint32_t _base = 0;
SSTVMode_t _mode; SSTVMode_t _mode = Scottie1;
bool _firstLine; bool _firstLine = true;
void tone(float freq, uint32_t len = 0); void tone(float freq, uint32_t len = 0);
}; };