mbv: clang-format
This commit is contained in:
@@ -10,7 +10,7 @@ Gpio* gpio0;
|
||||
void sleep(int ms) {
|
||||
for (int m = 0; m < ms; m++) {
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
asm volatile ( "" );
|
||||
asm volatile("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#include "timer.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "bios.h"
|
||||
@@ -5,14 +7,13 @@
|
||||
#include "intc.h"
|
||||
#include "interrupts.h"
|
||||
#include "pol0.h"
|
||||
#include "timer.h"
|
||||
|
||||
namespace {
|
||||
|
||||
Gpio* leds;
|
||||
Timer* timer;
|
||||
|
||||
void Timer0Isr() {
|
||||
void Timer0Isr() {
|
||||
static int counter = 0;
|
||||
leds->data = counter++;
|
||||
|
||||
|
@@ -23,16 +23,11 @@ XUartLite* uart0 = &uart0_inst;
|
||||
|
||||
volatile int incoming = 0;
|
||||
|
||||
void HandleUartRxFromIsr(void*, unsigned int) {
|
||||
incoming += 1;
|
||||
}
|
||||
void HandleUartRxFromIsr(void*, unsigned int) { incoming += 1; }
|
||||
|
||||
void HandleUartTxFromIsr(void*, unsigned int) {
|
||||
}
|
||||
void HandleUartTxFromIsr(void*, unsigned int) {}
|
||||
|
||||
void Uart0Isr() {
|
||||
XUartLite_InterruptHandler(uart0);
|
||||
}
|
||||
void Uart0Isr() { XUartLite_InterruptHandler(uart0); }
|
||||
|
||||
void InitUarts() {
|
||||
XUartLite_CfgInitialize(uart0, &uart0_config, uart0_config.RegBaseAddr);
|
||||
@@ -62,7 +57,8 @@ int main() {
|
||||
uint8_t c;
|
||||
while (XUartLite_Recv(uart0, &c, 1) > 0) {
|
||||
XUartLite_Send(uart0, &c, 1);
|
||||
while (XUartLite_IsSending(uart0)) {}
|
||||
while (XUartLite_IsSending(uart0)) {
|
||||
}
|
||||
}
|
||||
leds->data = 0xa1;
|
||||
while (1) {
|
||||
@@ -71,10 +67,12 @@ int main() {
|
||||
counter += 1;
|
||||
leds->data = counter;
|
||||
XUartLite_Send(uart0, &c, 1);
|
||||
while (XUartLite_IsSending(uart0)) {}
|
||||
while (XUartLite_IsSending(uart0)) {
|
||||
}
|
||||
while (XUartLite_Recv(uart0, &c, 1) > 0) {
|
||||
XUartLite_Send(uart0, &c, 1);
|
||||
while (XUartLite_IsSending(uart0)) {}
|
||||
while (XUartLite_IsSending(uart0)) {
|
||||
}
|
||||
}
|
||||
incoming -= 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user