Skip to content

Commit 4851f49

Browse files
committed
dsdd
1 parent e563c79 commit 4851f49

19 files changed

+612
-100
lines changed

OpenSourcesWith.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
files="*.c *.h *.S"
4+
5+
if [ ! -n "$1" ]; then
6+
program="/usr/share/code/code"
7+
else
8+
program="$1"
9+
fi
10+
11+
shift
12+
13+
if [ ! -n "$1" ]; then
14+
options="--unity-launch"
15+
else
16+
options="$1"
17+
fi
18+
19+
20+
21+
echo "Use $program with options $options on files $files"
22+
23+
24+
$program $options $files &
25+
26+
27+
exit $?

delays.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 bzt (bztsrc@github)
2+
* Copyright (C) 2022 (Unix69@github)
33
*
44
* Permission is hereby granted, free of charge, to any person
55
* obtaining a copy of this software and associated documentation
@@ -23,10 +23,8 @@
2323
*
2424
*/
2525

26-
#include "gpio.h"
2726

28-
#define SYSTMR_LO ((volatile unsigned int*)(MMIO_BASE+0x00003004))
29-
#define SYSTMR_HI ((volatile unsigned int*)(MMIO_BASE+0x00003008))
27+
#include "delays.h"
3028

3129
/**
3230
* Wait N CPU cycles (ARM CPU only)

delays.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 bzt (bztsrc@github)
2+
* Copyright (C) 2022 (Unix69@github)
33
*
44
* Permission is hereby granted, free of charge, to any person
55
* obtaining a copy of this software and associated documentation
@@ -23,7 +23,18 @@
2323
*
2424
*/
2525

26+
#ifndef DELAYS_H
27+
#define DELAYS_H
28+
29+
#include "gpio.h"
30+
31+
#define SYSTMR_LO ((volatile unsigned int*)(MMIO_BASE+0x00003004))
32+
#define SYSTMR_HI ((volatile unsigned int*)(MMIO_BASE+0x00003008))
33+
2634
void wait_cycles(unsigned int n);
2735
void wait_msec(unsigned int n);
2836
unsigned long get_system_timer();
2937
void wait_msec_st(unsigned int n);
38+
39+
40+
#endif

git-commit-push.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
commit_message=""
4+
if [ -z "$1" ]
5+
then
6+
while [ -z "${commit_message}" ]
7+
do
8+
echo "[$0] Set commit message"
9+
echo -n "[$0] message="
10+
read -t 60 commit_message
11+
if [ -z "${commit_message}" ]
12+
then
13+
echo "[$0] Invalid commit message"
14+
15+
fi
16+
done
17+
else
18+
echo "[$0] Commit message = $1"
19+
commit_message="$1"
20+
fi
21+
22+
echo "[$0] Commit..."
23+
sudo git commit -m "$commit_message"
24+
wait
25+
if [ $? -ne 0 ]
26+
then
27+
echo "[$0] Commit operation fail"
28+
exit
29+
fi
30+
31+
32+
echo "[$0] Push..."
33+
sudo git push -u origin master:master

git-init.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
git init
4+
git add *.c *.h *.S Makefile manqemu README.md link.ld
5+
git commit -m "first commit"
6+
git remote add origin "https://github.com/Unix69/BrainOS.git"
7+
git push -u origin master:master

gpio.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 bzt (bztsrc@github)
2+
* Copyright (C) 2022 (Unix69@github)
33
*
44
* Permission is hereby granted, free of charge, to any person
55
* obtaining a copy of this software and associated documentation
@@ -23,7 +23,12 @@
2323
*
2424
*/
2525

26-
#define MMIO_BASE 0x3F000000
26+
27+
#ifndef GPIO_H
28+
#define GPIO_H
29+
30+
31+
#include "mmu.h"
2732

2833
#define GPFSEL0 ((volatile unsigned int*)(MMIO_BASE+0x00200000))
2934
#define GPFSEL1 ((volatile unsigned int*)(MMIO_BASE+0x00200004))
@@ -43,3 +48,6 @@
4348
#define GPPUD ((volatile unsigned int*)(MMIO_BASE+0x00200094))
4449
#define GPPUDCLK0 ((volatile unsigned int*)(MMIO_BASE+0x00200098))
4550
#define GPPUDCLK1 ((volatile unsigned int*)(MMIO_BASE+0x0020009C))
51+
52+
53+
#endif

0 commit comments

Comments
 (0)