xeye_ atsu
/
FRDM_RaVem_JVM
JVM test
device_depend.cpp
- Committer:
- lynxeyed_atsu
- Date:
- 2013-08-24
- Revision:
- 5:047542b65d00
- Child:
- 6:b9d0d96b052f
File content as of revision 5:047542b65d00:
#include <stdio.h> #include <string.h> #include "device_depend.h" volatile static unsigned long msTicks; /* counts 1ms timeTicks */ Serial pc(USBTX, USBRX); // tx, rx Ticker tick; void hardware_init(void){ setup_systick(); } void uart_print(char *str){ pc.printf(str); return; } void uart_init(int baud_rate){ } int uart_read(void){ return pc.getc(); } int time_millis(void){ return msTicks; } void port_write(int port, int bit, int value){ //bit = value; } /*---------------------------------------------------------------------------- SysTick_Handler *----------------------------------------------------------------------------*/ void SysTickCount(void) { msTicks++; /* increment counter necessary in Delay() */ } void setup_systick (void) { msTicks = 0; tick.attach_us(&SysTickCount, 1000); //set 32kHz/8(word FIFO) sampling data } }