Compare commits

...

2 commits

Author SHA1 Message Date
Michael Hope 65a3ae90bb msp: rework the different size encoders.
Tidy the encoders up.  Reduce the code size stacking the encoders for
different sizes.

Signed-off-by: Michael Hope <mlhx@google.com>
2015-05-27 07:27:36 +02:00
Michael Hope bc7b879db2 various: mark more constant data so it goes into flash instead of RAM.
Signed-off-by: Michael Hope <mlhx@google.com>
2015-05-27 07:27:24 +02:00
6 changed files with 26 additions and 42 deletions

View file

@ -5,7 +5,7 @@
uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */
__I uint8_t AHBPrescTable[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9 };
static const uint8_t AHBPrescTable[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9 };
uint32_t hse_value = 8000000;

View file

@ -190,8 +190,8 @@
* @{
*/
static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
static __I uint8_t ADCPrescTable[4] = {2, 4, 6, 8};
static const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
static const uint8_t ADCPrescTable[4] = {2, 4, 6, 8};
extern uint32_t hse_value;
/**

View file

@ -83,7 +83,7 @@ static char lineBuffer[SCREEN_CHARACTER_COLUMN_COUNT + 1];
#define HALF_SCREEN_CHARACTER_COLUMN_COUNT (SCREEN_CHARACTER_COLUMN_COUNT / 2)
#define IS_SCREEN_CHARACTER_COLUMN_COUNT_ODD (SCREEN_CHARACTER_COLUMN_COUNT & 1)
const char* pageTitles[] = {
static const char* const pageTitles[] = {
"CLEANFLIGHT",
"ARMED",
"BATTERY",

View file

@ -140,12 +140,12 @@ void useRcControlsConfig(modeActivationCondition_t *modeActivationConditions, es
#define BASEFLIGHT_IDENTIFIER "BAFL";
#define FLIGHT_CONTROLLER_IDENTIFIER_LENGTH 4
static const char *flightControllerIdentifier = CLEANFLIGHT_IDENTIFIER; // 4 UPPER CASE alpha numeric characters that identify the flight controller.
static const char * const flightControllerIdentifier = CLEANFLIGHT_IDENTIFIER; // 4 UPPER CASE alpha numeric characters that identify the flight controller.
#define FLIGHT_CONTROLLER_VERSION_LENGTH 3
#define FLIGHT_CONTROLLER_VERSION_MASK 0xFFF
const char *boardIdentifier = TARGET_BOARD_IDENTIFIER;
static const char * const boardIdentifier = TARGET_BOARD_IDENTIFIER;
#define BOARD_IDENTIFIER_LENGTH 4 // 4 UPPER CASE alpha numeric characters that identify the board being used.
#define BOARD_HARDWARE_REVISION_LENGTH 2
@ -396,40 +396,24 @@ static mspPort_t mspPorts[MAX_MSP_PORT_COUNT];
static mspPort_t *currentPort;
static void serialize32(uint32_t a)
{
static uint8_t t;
t = a;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
t = a >> 8;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
t = a >> 16;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
t = a >> 24;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
}
static void serialize16(int16_t a)
{
static uint8_t t;
t = a;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
t = a >> 8 & 0xff;
serialWrite(mspSerialPort, t);
currentPort->checksum ^= t;
}
static void serialize8(uint8_t a)
{
serialWrite(mspSerialPort, a);
currentPort->checksum ^= a;
}
static void serialize16(uint16_t a)
{
serialize8((uint8_t)(a >> 0));
serialize8((uint8_t)(a >> 8));
}
static void serialize32(uint32_t a)
{
serialize16((uint16_t)(a >> 0));
serialize16((uint16_t)(a >> 16));
}
static uint8_t read8(void)
{
return currentPort->inBuf[currentPort->indRX++] & 0xff;

View file

@ -15,7 +15,7 @@
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
char *targetName = __TARGET__;
char *shortGitRevision = __REVISION__;
char *buildDate = __DATE__;
char *buildTime = __TIME__;
const char * const targetName = __TARGET__;
const char * const shortGitRevision = __REVISION__;
const char * const buildDate = __DATE__;
const char * const buildTime = __TIME__;

View file

@ -25,13 +25,13 @@
#define MW_VERSION 231
extern char* targetName;
extern const char* const targetName;
#define GIT_SHORT_REVISION_LENGTH 7 // lower case hexadecimal digits.
extern char* shortGitRevision;
extern const char* const shortGitRevision;
#define BUILD_DATE_LENGTH 11
extern char* buildDate; // "MMM DD YYYY" MMM = Jan/Feb/...
extern const char* const buildDate; // "MMM DD YYYY" MMM = Jan/Feb/...
#define BUILD_TIME_LENGTH 8
extern char* buildTime; // "HH:MM:SS"
extern const char* const buildTime; // "HH:MM:SS"