Skip to content

Commit

Permalink
pack src script
Browse files Browse the repository at this point in the history
  • Loading branch information
oblaser committed May 12, 2022
1 parent de346ad commit e9a4c09
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 17 deletions.
27 changes: 26 additions & 1 deletion build/dep_globals.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

# author Oliver Blaser
# date 04.05.2022
# date 12.05.2022
# copyright MIT - Copyright (c) 2022 Oliver Blaser

versionstr=$(head -n 1 dep_vstr.txt)
prjDirName="rpihal"

function ptintTitle()
{
Expand All @@ -15,3 +16,27 @@ function ptintTitle()
echo -e "\033[3$2m --=====# \033[9$2m$1\033[3$2m #=====--\033[39m"
fi
}

function writeReadmeFile()
{
echo "" > $1
echo " \$\$ \$\$\$" >> $1
echo " \$\$ \$\$ \$\$\$" >> $1
echo " \$\$ \$\$ \$\$" >> $1
echo " \$\$ \$\$" >> $1
echo "\$\$ \$\$\$\$\$ \$\$ \$\$\$\$\$ \$\$\$ \$\$ \$\$\$\$\$ \$\$\$\$\$ \$\$ \$\$" >> $1
echo "\$\$\$\$\$\$\$\$\$ \$\$\$\$\$\$\$\$\$ \$\$\$ \$\$\$\$\$\$\$\$\$ \$\$\$\$\$\$\$\$\$ \$\$" >> $1
echo "\$\$\$ \$\$\$ \$\$\$ \$\$\$ \$\$ \$\$\$ \$\$\$ \$\$\$ \$\$\$ \$\$" >> $1
echo "\$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$" >> $1
echo "\$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$ \$\$" >> $1
echo "\$\$ \$\$\$ \$\$\$ \$\$ \$\$ \$\$ \$\$\$ \$\$\$ \$\$" >> $1
echo "\$\$ \$\$\$\$\$\$\$\$\$ \$\$\$\$ \$\$ \$\$ \$\$\$\$\$\$\$\$\$ \$\$\$\$" >> $1
echo "\$\$ \$\$ \$\$\$\$ \$\$\$\$ \$\$ \$\$ \$\$\$\$\$ \$\$ \$\$\$\$" >> $1
echo " \$\$" >> $1
echo " \$\$" >> $1
echo " \$\$ v$versionstr" >> $1
echo "" >> $1
echo "" >> $1
echo "" >> $1
echo "GitHub https://github.com/oblaser/rpihal/" >> $1
}
2 changes: 1 addition & 1 deletion build/dep_vstr.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0-alpha
0.1.0-rc
29 changes: 29 additions & 0 deletions build/pack_source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# author Oliver Blaser
# date 12.05.2022
# copyright MIT - Copyright (c) 2022 Oliver Blaser

source dep_globals.sh

packedDir="./packed"
outDirName="${prjDirName}_src"
outDir="$packedDir/$outDirName"
archive="$packedDir/${prjDirName}_src_v$versionstr.tar.gz"



rm -rf $outDir

mkdir -p $outDir/$prjDirName
mkdir $outDir/$prjDirName/include
mkdir $outDir/$prjDirName/src

cp -r ../include/* $outDir/$prjDirName/include
cp -r ../src/* $outDir/$prjDirName/src

writeReadmeFile $outDir/$prjDirName/readme.txt
cp ../license.txt $outDir/$prjDirName

rm -f $archive
tar -czf $archive -C $outDir $prjDirName
5 changes: 3 additions & 2 deletions build/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Build Scripts

> `cmake` isn't set up yet, thus `build.sh` doesn't do something useful for now.
The scripts must have this directory as working directory.

`dep_*` files are dependencies of the scripts and should not be called directly.
Expand All @@ -20,5 +22,4 @@ Eexcept the `pack_*` scripts don't.
### files to edit on version update

- `build/dep_vstr.txt`
- ~~`build/dep_readme.txt`~~
- `include/rpihal/defs.h.h`
- `include/rpihal/defs.h`
2 changes: 1 addition & 1 deletion include/rpihal/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {
#define RPIHAL_VERSION_MAJOR 0
#define RPIHAL_VERSION_MINOR 1
#define RPIHAL_VERSION_PATCH 0
#define RPIHAL_VERSION_PRERELEASE "alpha"
#define RPIHAL_VERSION_PRERELEASE "rc"

#define RPIHAL_VERSION_ISPRERELEASE 1

Expand Down
26 changes: 15 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Raspberry Pi Hardware Abstraction Layer
# raspihal

Not completed. Grows as I need it.
A Raspberry Pi Hardware Abstraction Layer for C/C++ projects.

> Not completed. Grows as I need it.

# GPIO Module

> __CAUTION!__ Currently only supports models with the _~~BCM283x~~_ BCM2836 and BCM2837. Be aware of the different header pinouts on the various boards!
## GPIO Module

> __CAUTION!__ look for _DEVICE SPECIFIC_ or _DEVSPEC_ comments in code.
> __CAUTION!__ Currently only supports models with the BCM2836, BCM2837 and BCM2837B0. _~~BCM283x. Be aware of the different header pinouts on the various boards!~~_
>
> Search for _DEVSPEC_ comments in code to find the critical portions.
Supported Models:
- 2B
- 3A+
- 3B
- 3B+
### Supported Models:
`2B`
`3A+`
`3B`
`3B+`

## Links
These all have the 40 pin header, which has the same pinout on all models listed above.

### Links

- https://elinux.org/RPi_GPIO_Code_Samples
- https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#general-purpose-io-gpio
Expand Down
4 changes: 3 additions & 1 deletion release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@



### v0.1.0
### v0.1.0-rc

New
- init pin as IN, OUT or AF
- read and write I/O pin
- Serial/UART library

0 comments on commit e9a4c09

Please sign in to comment.