mirror of
https://gitee.com/Lamdonn/varch.git
synced 2025-12-06 16:56:42 +08:00
44 lines
815 B
C
44 lines
815 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include "init.h"
|
|
#include "tool.h"
|
|
#include "ramt.h"
|
|
#include "kern.h"
|
|
|
|
#define TASK_PERIOD 5 // ms
|
|
|
|
static uint8_t buffer[128];
|
|
static RAMT ramt_object;
|
|
|
|
static void test_task(void)
|
|
{
|
|
static int count = 0;
|
|
|
|
count += TASK_PERIOD;
|
|
|
|
ramt_task(&ramt_object);
|
|
|
|
if (count % 1000 == 0)
|
|
{
|
|
printf("result %08X\r\n", ramt_result(&ramt_object));
|
|
}
|
|
}
|
|
|
|
static void test_ramt(void)
|
|
{
|
|
task_t task;
|
|
|
|
printf("ramt test!\r\n");
|
|
|
|
ramt_object.base = (void *)buffer;
|
|
ramt_object.size = sizeof(buffer);
|
|
ramt_init(&ramt_object);
|
|
|
|
ramt_start(&ramt_object, RAMT_MODE_NORMAL, 0xFFFFFFFF);
|
|
|
|
task = task_create(TASK_PERIOD, test_task);
|
|
printf("task <%d>\r\n", task);
|
|
}
|
|
init_export_app(test_ramt);
|