Skip to content

Commit

Permalink
Replace travis ci with github action (#13) (#14)
Browse files Browse the repository at this point in the history
* Replace travis ci with github action (#13)

* Replace travis ci with github action

* Fixed boards to board

* Fixed indentation error

* Update build.yml

* Retrive pressure sensor data from MPX5100
  • Loading branch information
k105la authored Jun 8, 2020
1 parent 0a431e0 commit b37de77
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
- devel

jobs:
build:
name: Checkout master
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: cd board && sh install.sh
- name: Build PanFLUte firmware
run: cd board && make
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions board/adc/adc.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#include "../driver/adc.h"


void adcInit(void) {
/* Enable ADC */
ADCSRA |= (1 << ADEN);
/* Left Adjust Results */
ADCSRB |= (1 << ADLAR);
}

/*

uint8_t adcStart(void) {
ADCSRA |= (1 << ADSC); // Start ADC conversion
loop_until_bit_is_clear(ADCSRA, ADSC);
rawPresureData = ADCH; // Max is 8bit value
uint8_t rawPresureData = ADCH; // Max is 8bit value

return rawPresureData;
}
*/
3 changes: 1 addition & 2 deletions board/driver/adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
#include <stdint.h>

void adcInit(void);
//uint8_t adcStart(void);
//uint8_t rawPressureData;
uint8_t adcStart(void);
10 changes: 6 additions & 4 deletions board/main.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#include "driver/usart.h"
#include "driver/led.h"
#include "driver/adc.h"

static FILE mystdout = FDEV_SETUP_STREAM(print, NULL, _FDEV_SETUP_RW);

int main(void) {
int main(void) {
adcInit();
usartInit(MYUBRR);
stdout = &mystdout;
while(1) {
printf("%d\n", 21 + 79);
delay_ms(1000);
while(1) {
printf("Should be sensor data: %d\n", adcStart());
delay_ms(1000);
}
return 0;
}

0 comments on commit b37de77

Please sign in to comment.