Commit f1827d58 authored by Rafal Babski's avatar Rafal Babski

Optimizations in templates MSP430

FreeRtosConfig.h optimization
msp430-serial-minimal driver optimization
parent 12f2af70
Pipeline #1575 failed with stage
in 8 minutes and 18 seconds
......@@ -38,22 +38,22 @@
#define configSUPPORT_STATIC_ALLOCATION 1
#define configUSE_PREEMPTION 1
#define configMAX_PRIORITIES ( 10 )
#define configMAX_PRIORITIES ( 5 )
#define configCPU_CLOCK_HZ ( 8000000 )
#define configTICK_RATE_HZ ( 1000 )
#define configMAX_TASK_NAME_LEN ( 15 )
#define configMAX_TASK_NAME_LEN ( 2 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_CO_ROUTINES 0
#define configUSE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_RECURSIVE_MUTEXES 0
#define configQUEUE_REGISTRY_SIZE 0
#define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_COUNTING_SEMAPHORES 0
#define configUSE_ALTERNATIVE_API 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#define configNUMTHREAD_LOCAL_STORAGE_POINTERS 0
#define configENABLE_BACKWARD_COMPATIBILITY 0
#define configUSE_TASK_NOTIFICATIONS 0
......@@ -61,7 +61,7 @@
#define configUSE_TICK_HOOK 0
#define configUSE_IDLE_HOOK 0
#define configUSE_MALLOC_FAILED_HOOK 0
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configCHECK_FOR_STACK_OVERFLOW 0
/* Software timer related definitions. */
#define configUSE_TIMERS 1
......@@ -78,31 +78,28 @@
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerTaskHandle 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define INCLUDE_xQueueGetMutexHolder 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xEventGroupSetBitsFromISR 1
#define INCLUDE_xTimerPendFunctionCall 1
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
#define INCLUDE_vTaskPrioritySet 0
#define INCLUDE_uxTaskPriorityGet 0
#define INCLUDE_vTaskDelete 0
#define INCLUDE_vTaskSuspend 0
#define INCLUDE_xResumeFromISR 0
#define INCLUDE_vTaskDelayUntil 0
#define INCLUDE_vTaskDelay 0
#define INCLUDE_xTaskGetSchedulerState 0
#define INCLUDE_xTaskGetCurrentTaskHandle 0
#define INCLUDE_uxTaskGetStackHighWaterMark 0
#define INCLUDE_xTaskGetIdleTaskHandle 0
#define INCLUDE_eTaskGetState 0
#define INCLUDE_xEventGroupSetBitFromISR 0
#define INCLUDE_xTimerPendFunctionCall 0
#define INCLUDE_xTaskAbortDelay 0
#define INCLUDE_xTaskGetHandle 0
#define INCLUDE_xTaskResumeFromISR 0
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
#define configTICK_VECTOR TIMER0_A0_VECTOR
#define configCOMMAND_INT_MAX_OUTPUT_SIZE 1500
#define configINCLUDE_QUERY_HEAP_COMMAND 0
#ifdef __LARGE_DATA_MODEL__
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 85 )
#else
......
......@@ -13,7 +13,7 @@
all: partitions
partitions: freertos
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Debug" -cargs:C -DSTATIC=""
gprbuild -p -P @_LOWER:Partition_Names_@.gpr -XCFG="Release" -cargs:C -DSTATIC=""
freertos:
sh gather_freertos_files.sh
......
......@@ -92,19 +92,25 @@ project @_CAPITALIZE:Name_@ is
"-I.",
"-I../FreeRTOS/Source/include",
"-I../FreeRTOS/Source/portable/GCC/MSP430FR5969",
"-I../../deploymentview_final/@_LOWER:Name_@",
"-I../../deploymentview_final/polyorb-hi-c/include",
"-mmcu=msp430fr5969",
"-msmall",
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wno-unused-parameter",
"-O2");
"-Wl,--gc-sections",
"-g",
"-Os");
when "Debug" =>
for Default_Switches ("C") use
("-I/opt/ti/msp430-gcc/include/",
"-I.",
"-I../FreeRTOS/Source/include",
"-I../FreeRTOS/Source/portable/GCC/MSP430FR5969",
"-I../../deploymentview_final/@_LOWER:Name_@",
"-I../../deploymentview_final/polyorb-hi-c/include",
"-mmcu=msp430fr5969",
"-msmall",
"-Wall",
......
......@@ -25,7 +25,6 @@ __attribute__ ((persistent)) uint8_t prv_@_LOWER:Thread_Name_@_queue_area[@_Queu
__attribute__ ((persistent)) StaticTask_t prv_@_LOWER:Thread_Name_@_tcb = {0};
__attribute__ ((persistent)) StackType_t prv_@_LOWER:Thread_Name_@_stack[@_Stack_Size_In_Bytes_@ / sizeof(StackType_t)] = {0};
//__attribute__ ((persistent)) StackType_t prv_@_LOWER:Thread_Name_@_stack[configMINIMAL_STACK_SIZE] = {0};
static void initialize_thread_@_LOWER:Thread_Name_@()
{
......@@ -37,7 +36,6 @@ static void initialize_thread_@_LOWER:Thread_Name_@()
xTaskCreateStatic(prv_@_Thread_Name_@Task,
"@_Thread_Name_@",
@_Stack_Size_In_Bytes_@ / sizeof(StackType_t),
//configMINIMAL_STACK_SIZE,
NULL,
@_Priority_@,
prv_@_LOWER:Thread_Name_@_stack,
......
......@@ -43,7 +43,7 @@
#include "msp430_serial_minimal.h"
#define RING_BUFFER_SIZE 36
#define RING_BUFFER_SIZE 16
typedef struct
{
......@@ -235,6 +235,9 @@ static void uart_putc(uint8_t c)
ring_buffer_push(&stdout_buffer, c);
/* enable interrupt to transmit */
UCA0IE |= UCTXIE;
__asm__ volatile("nop");
__asm__ volatile("nop");
}
static uint8_t uart_getc(void)
......@@ -342,20 +345,8 @@ void process_packet(uint8_t* data, int length)
}
}
int serial_total_received_characters = 0;
uint8_t serial_last_received_characters[20] = {0};
int serial_last_received_characters_index = 0;
void spg_serial_msp430_minimal_poller(void* param)
{
serial_total_received_characters = 0;
int dummy_i;
for(dummy_i = 0; dummy_i < 20; ++ dummy_i)
{
serial_last_received_characters[dummy_i] = '\0';
}
serial_last_received_characters_index = 0;
uint8_t buffer[32];
int counter = 0;
enum PACKET_STATE state = WAITING_FOR_START_BYTE;
......@@ -363,13 +354,6 @@ void spg_serial_msp430_minimal_poller(void* param)
while(1)
{
uint8_t c = uart_getc();
++serial_total_received_characters;
serial_last_received_characters[serial_last_received_characters_index] = c;
++serial_last_received_characters_index;
if(serial_last_received_characters_index == 20)
{
serial_last_received_characters_index = 0;
}
switch(state)
{
......@@ -405,6 +389,7 @@ void spg_serial_msp430_minimal_poller(void* param)
case ESCAPE_STARTED:
buffer[counter] = c;
++counter;
state = RECEIVING_MESSAGE;
break;
......@@ -412,8 +397,8 @@ void spg_serial_msp430_minimal_poller(void* param)
}
}
static SemaphoreHandle_t sender_semaphore;
static StaticSemaphore_t sender_semaphore_buffer;
static SemaphoreHandle_t sender_semaphore = {0};
static StaticSemaphore_t sender_semaphore_buffer = {0};
void spg_serial_msp430_minimal_sender(uint8_t* data, uint32_t length, uint32_t port)
{
......
......@@ -38,7 +38,7 @@
struct Request
{
uint32_t m_length;
uint8_t m_data[8];
uint8_t m_data[16];
};
......@@ -48,7 +48,7 @@ struct Message
{
uint32_t m_port;
uint32_t m_length;
uint8_t m_data[8];
uint8_t m_data[16];
};
......
......@@ -49,13 +49,11 @@ void vm_@_LOWER:Parent_Function_@_@_LOWER:Name_@
struct Request request;
if(size_IN_buf_@_LOWER:Param_Names_@ != 0)
{
//request.m_data = pvPortMalloc(size_IN_buf_@_LOWER:Param_Names_@);
request.m_length = size_IN_buf_@_LOWER:Param_Names_@;
memcpy(request.m_data, IN_buf_@_LOWER:Param_Names_@, size_IN_buf_@_LOWER:Param_Names_@);
}
else
{
//request.m_data = NULL;
request.m_length = 0;
}
deliver_to_@_Remote_Function_Names_@_@_Remote_Interface_Names_@(&request);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment