aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/TestApp/App.xaml
blob: 68dd93e92576c47027c1e7de81ca660f092e621b (plain)
1
2
3
4
5
6
7
8
9
<Application x:Class="TestApp.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:TestApp"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
         
    </Application.Resources>
</Application>
.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * StubRealTimeUsage.c

 *
 *  Created on: 15 may 2018
 *      Author: shlomo
 */
/*
 * Stub_RealTimeUsage.c
 *
 *  Created on: May 14, 2018
 *      Author: avi
 */



#include <Container.h>
#include <DataDef.h>

#include <PMR/Stubs/StubRealTimeUsageResponse.pb-c.h>
#include <PMR/Stubs/StubRealTimeUsageRequest.pb-c.h>

#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_uart.h"

#include "Drivers/USB_Communication/USBCDCD.h"


#include "MessageContainer.pb-c.h"

#include "Stub_Status.h"
#include "common/utilities/idle_task.h"


#include "Modules/thread/thread.h"


void Stub_RealTimeUsageRequest(MessageContainer* requestContainer)
{

    MessageContainer responseContainer;

    StubRealTimeUsageRequest* request = stub_real_time_usage_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);

    StubRealTimeUsageResponse response =   STUB_REAL_TIME_USAGE_RESPONSE__INIT;


    response.n_percentile = 101;
    response.percentile = my_malloc(sizeof(response.percentile)*response.n_percentile);
    if (response.percentile)
        IdleTaskGetLoadTable(response.percentile);
    else
        response.n_percentile = 0;
    //free(request);
    //-------------------------------------------------------------------------------------------
    responseContainer = createContainer(MESSAGE_TYPE__StubRealTimeUsageResponse, requestContainer->token, true, &response, &stub_real_time_usage_response__pack, &stub_real_time_usage_response__get_packed_size);
    uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer));
    size_t container_size = message_container__pack(&responseContainer, container_buffer);
    free(responseContainer.data.data);
    SendChars((char*)container_buffer, container_size);
    if (response.percentile)
        free(response.percentile);

    stub_real_time_usage_request__free_unpacked(request,NULL);
}