aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/Utilities/Utils.c')
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/Utils.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
index 0a586d9cb..10bfdc8d9 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c
@@ -130,9 +130,6 @@ void InitWatchdog(uint32_t clock)
void utilsInit(uint32_t ui32SysClock)
{
- cb_init();
-// SysTickPeriodSet(120000);
-// SysTickEnable();
// Configure Hibernate module clock.
//
HibernateEnableExpClk(ui32SysClock);
@@ -180,70 +177,4 @@ void UtilsSetCommunicationOk(void)
sendDataToHost = true;
}
-typedef struct circular_buffer
-{
- void *buffer; // data buffer
- void *buffer_end; // end of data buffer
- uint16_t capacity; // maximum number of items in the buffer
- uint16_t count; // number of items in the buffer
- uint16_t sz; // size of each item in the buffer
- void *head; // pointer to head
- void *tail; // pointer to tail
-} circular_buffer;
-
-uint8_t LogBuffer[8002];
-circular_buffer cb;
-void cb_init()
-{
- //cb.buffer = malloc(capacity * sz);
- //if(cb.buffer == NULL)
- // handle error
- cb.buffer = LogBuffer;
- cb.buffer_end = &LogBuffer[3950];
- cb.capacity = 4000;
- cb.count = 0;
- cb.sz = 60;
- cb.head = cb.buffer;
- cb.tail = cb.buffer;
-}
-
-void cb_free(circular_buffer *cb)
-{
- //free(cb.buffer);
- // clear out other fields too, just to be safe
-}
-void cb_push_back(/*circular_buffer *cb,*/ const void *item, int size)
-{
- return;
- /*
- if(cb.count == cb.capacity){
- return;
- // handle error
- }
- if ((int)(cb.head) + size > (int)(cb.buffer_end)){
- size = (int)(cb.buffer_end) - (int)(cb.head);
- }
-
- memcpy(cb.head, item, size);
- cb.head = (char*)cb.head + size;
- if(cb.head >= cb.buffer_end)
- cb.head = cb.buffer;
- cb.count++;
-// if (sendDataToHost)
-// SendMessageToHost(DEBUG_LOG,item);
-
- */
-}
-
-void cb_pop_front(/*circular_buffer *cb,*/ void *item)
-{
- if(cb.count == 0){
- // handle error
- }
- memcpy(item, cb.tail, cb.sz);
- cb.tail = (char*)cb.tail + cb.sz;
- if(cb.tail == cb.buffer_end)
- cb.tail = cb.buffer;
- cb.count--;
-}