Skip to content
Snippets Groups Projects
Commit 4e16b364 authored by 488_MP-4's avatar 488_MP-4
Browse files

ping pong

parent fdd11425
No related branches found
No related tags found
3 merge requests!109Final sdmay24-32 merge to master,!104adding cflib to this branch,!101adding baremetal programs
Showing with 1099 additions and 1047 deletions
......@@ -30,6 +30,7 @@ OBJS +=build/interrupt.o
OBJS +=build/main.o
OBJS +=build/mmu_cfg.o
OBJS +=build/uart.o
OBJS +=build/memory.o
# From ../mmu
OBJS +=build/mmu.o
......
No preview for this file type
File added
......@@ -7,7 +7,7 @@
#include "timers.h"
#include "semphr.h"
#include "uart.h"
#include "memory.h"
/*
* Prototypes for the standard FreeRTOS callback/hook functions implemented
......@@ -97,10 +97,6 @@ void ledblink(int on)
}
#define SHARED_MEMORY_ADDRESS 0x3F000000
#define SHARED_MEMORY_ADDRESS2 0x3F001000
volatile int* shared_memory = (volatile int*) SHARED_MEMORY_ADDRESS;
volatile int* shared_memory2 = (volatile int*) SHARED_MEMORY_ADDRESS2;
void main(void)
{
......@@ -109,6 +105,9 @@ void main(void)
uart_puts("\r\n****************************\r\n");
uart_puts("\r\n FreeRTOS UART Sample\r\n");
uart_puts("\r\n****************************\r\n");
shm_loop();
/*
*shared_memory = 1;
uart_puts("\r\n Shared memory loc 1 has been set to 1\r\n");
while(*shared_memory != 0)
......@@ -118,6 +117,7 @@ void main(void)
uart_puts("\r\n Shared memory loc 1 has been set to 0\r\n");
*shared_memory2 = 1;
uart_puts("\r\n Shared memory loc 2 has been set to 1\r\n");
*/
xTaskCreate(TaskA, "Task A", 512, NULL, 0x10, &task_a);
......
#include "memory.h"
void shm_loop()
{
volatile int* shared_memory = (volatile int*) SHARED_MEMORY_ADDRESS;
while(1)
{
if(*shared_memory == 0xFF)
{
uart_puthex(*(shared_memory + 8));
uart_putchar(*(shared_memory + 8));
uart_putchar(*(shared_memory + 9));
uart_putchar(*(shared_memory + 10));
uart_putchar(*(shared_memory + 11));
uart_puts("\r\noutput read\r\n");
*shared_memory = 0x00;
}
}
}
\ No newline at end of file
#include <stddef.h>
#include <stdint.h>
#include "uart.h"
#define SHARED_MEMORY_ADDRESS 0x3F000000
void shm_loop();
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment