diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ffac913 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 31dfd20..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: c -services: docker -before_install: -- sudo apt-get update -qq -- docker build -t panflute:1.0 . -install: sudo apt-get install -qq gcc-avr binutils-avr avr-libc -before_script: cd board -script: make diff --git a/board/adc/adc.c b/board/adc/adc.c index 54a9da9..7bf7c08 100644 --- a/board/adc/adc.c +++ b/board/adc/adc.c @@ -1,5 +1,6 @@ #include "../driver/adc.h" + void adcInit(void) { /* Enable ADC */ ADCSRA |= (1 << ADEN); @@ -7,11 +8,11 @@ void adcInit(void) { 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; } -*/ diff --git a/board/driver/adc.h b/board/driver/adc.h index 8458d0d..8774184 100644 --- a/board/driver/adc.h +++ b/board/driver/adc.h @@ -2,5 +2,4 @@ #include void adcInit(void); -//uint8_t adcStart(void); -//uint8_t rawPressureData; +uint8_t adcStart(void); diff --git a/board/main.c b/board/main.c index 0e67f1e..3823f0e 100644 --- a/board/main.c +++ b/board/main.c @@ -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; }