From 1022a5f8f40fdf84f8ac5f370daeaa604a2778f6 Mon Sep 17 00:00:00 2001
From: Akil M Hylton
Date: Mon, 8 Jun 2020 18:52:01 -0700
Subject: [PATCH] Adding github badge (#19)
* 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
* Some code that gives back PSI
* Update build.yml
* Update README.md
* some test
* Should fix merge conflict
* Moved offset to adc driver
* Removed unused delay lib
---
.github/workflows/build.yml | 4 +-
README.md | 2 +-
board/Makefile | 2 +-
board/adc/adc.c | 13 +++-
board/driver/adc.h | 4 +-
board/driver/mpx5100.h | 2 +
board/driver/usart.h | 1 -
board/firmware/main.bin | Bin 3519 -> 20904 bytes
board/firmware/main.hex | 126 ++++++++++++++++++++++++++++++++++--
board/main.c | 16 +++--
10 files changed, 150 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ffac913..65f40be 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -1,3 +1,5 @@
+name: panflute tests
+
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
@@ -18,4 +20,4 @@ jobs:
- name: Install dependencies
run: cd board && sh install.sh
- name: Build PanFLUte firmware
- run: cd board && make
+ run: cd board && make
\ No newline at end of file
diff --git a/README.md b/README.md
index d2a02bf..7e79f94 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
-[![Build Status](http://img.shields.io/travis/COVID-19-electronic-health-system/PanFLUte/master.svg?style=for-the-badge)](https://travis-ci.org/COVID-19-electronic-health-system/PanFLUte)
+![panflute tests](https://github.com/COVID-19-electronic-health-system/PanFLUte/workflows/panflute%20tests/badge.svg)
PanFLUte (Pneumonia analyzing node for FLU to everyone) is an open source spirometer.
It is used to measures the amount of air you're able to breathe in and out.
diff --git a/board/Makefile b/board/Makefile
index 5d23fe3..b4c0473 100644
--- a/board/Makefile
+++ b/board/Makefile
@@ -3,7 +3,7 @@ PROGRAMMER=atmelice_isp
F_CPU=1000000
CC=avr-gcc
OBJCOPY=avr-objcopy
-CFLAGS=-Wall -g -Os -mmcu=${MCU} -DF_CPU=${F_CPU} -Wl,-u,vfprintf
+CFLAGS=-Wall -g -Os -mmcu=${MCU} -DF_CPU=${F_CPU} -Wl,-u,vfprintf -lprintf_flt -lm
TARGET=main
SRC=main.c
ADC_LIB=adc/adc.c
diff --git a/board/adc/adc.c b/board/adc/adc.c
index 7bf7c08..64397b4 100644
--- a/board/adc/adc.c
+++ b/board/adc/adc.c
@@ -3,11 +3,19 @@
void adcInit(void) {
/* Enable ADC */
- ADCSRA |= (1 << ADEN);
+ ADCSRA = (1 << ADEN) | (1 << ADSC);
/* Left Adjust Results */
- ADCSRB |= (1 << ADLAR);
+ //ADCSRB = (1 << ADLAR);
+ //printf("ADC has started\n");
}
+/*
+void getPSI(void) {
+ ADCSRA |= (1 << ADSC); // Start ADC conversion
+ float rawPresureData = ADCH; // Max is 8bit value
+ printf("PSI: %.2f", (rawPresureData / 255.0) * 14.5);
+ delay_ms(100);
+}
uint8_t adcStart(void) {
ADCSRA |= (1 << ADSC); // Start ADC conversion
@@ -16,3 +24,4 @@ uint8_t adcStart(void) {
return rawPresureData;
}
+*/
diff --git a/board/driver/adc.h b/board/driver/adc.h
index 8774184..06147ca 100644
--- a/board/driver/adc.h
+++ b/board/driver/adc.h
@@ -1,5 +1,7 @@
#include
#include
+#define OFFSET 44
void adcInit(void);
-uint8_t adcStart(void);
+//void getPSI(void);
+//uint8_t adcStart(void);
diff --git a/board/driver/mpx5100.h b/board/driver/mpx5100.h
index 1d77d7b..017bd68 100644
--- a/board/driver/mpx5100.h
+++ b/board/driver/mpx5100.h
@@ -1 +1,3 @@
+#include "../driver/adc.h"
// #define SIGNAL_OFFSET // This value corresponds to an air flow of 0
+
diff --git a/board/driver/usart.h b/board/driver/usart.h
index a6ed3ba..6a7b304 100644
--- a/board/driver/usart.h
+++ b/board/driver/usart.h
@@ -8,4 +8,3 @@ void usartInit(unsigned int ubrr);
void usartTransmit(unsigned char data);
unsigned char usartReceive(void);
int print(char c, FILE *stream);
-
diff --git a/board/firmware/main.bin b/board/firmware/main.bin
index 6f3e45a9f33e845ffce9e5d93088e8022b69d058..311d1aaf8683c9f61c9d6f75b8d4e44a90aad1b2 100755
GIT binary patch
literal 20904
zcmeHPdw5mVmER}f5uOQxfJjIJ0TN8^D>pZfE02&HFak+Tf}&L~H_6RI^CG#4(oW@G
z5-`3nuM0lf5w*3o)7k<3d`{))bXsbsCUp9Boa&T|){%C!gqnh_NanZpIp?08o#@wo
z^YNdX@7(iSzrFU_Yp?w}udt_R>n24}n2};w1v4Zk$g)z#uE5#Jl36TEWASV@&mS}j
z;C$>`JZ~8w9n*-?kAygI$ftwSOdLjjqMD<+)NIwMW~mOPj_LU7;>lQ`BTNNnNHUs!P=?)p@B&uMV9#5&7-0UmTkk
zIUG3>`Q!WNBQfgK-Z}lx*pE#Auk$I9XHFf7C~9K=cO6HkpE`fzaNu8mGNe9Y{ra
zeUX&1;D+7}r_M8#G4-LYcL&cXht6^-E*$)D-%D}f-hsU=I1pkzr-B3f*#1axpquT*
z?|z27zWppbc3~(u5QG$jbT>(TB#C*!NN*%AeBzO~aB{>JNn4aRy?EsJXGS7+y)LVF
zed*{>TzF{UU)1E6uJAA7f;>~D=(f5M*1SX11pu_
zK&tX)?X*uaCZ
zKQyp(_`VPNe{ZxizE}JA_7F?mzIuupH}}S*p7@88*rD{1&Tw7$#gBJQed&BKGi;3u
zACCNUM85y}Gs+gPxAd=yuWwi150zkFs?yuHQi&OUH}dl9{{*d%{x}l3=k-SA
zYs$UK1!d9Rg?qa~p)vKfHx=dJ)yg?#Aaq_C_-tR_z*wknkJ7VZ#^^Jz?Q`Ufn%q7|
z%INb-Z{)QTr-%A7QZnorW2Zj8JTh{hWA{kzXb`_$j;BXgWG4F()CU|ljs&xIK}y*<
zL+#4kyEE7FUgqz1E>}O!{AA}!)nQq!=3K~BlRrv}Ut{YTbz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Lao?Vvn#Zz
zWLNKj_AfWCoU26U(b;7sqJ&ZTAgiq6io_45?mWuHmJTy&3D}9blZQ4ab51BcU6qup
HVJ6sricC6D
diff --git a/board/firmware/main.hex b/board/firmware/main.hex
index ff16a90..694d83f 100644
--- a/board/firmware/main.hex
+++ b/board/firmware/main.hex
@@ -1,7 +1,121 @@
-:100000001DC024C023C022C021C020C01FC01EC0EC
-:100010001DC01CC01BC01AC019C018C017C016C014
-:1000200015C014C013C012C011C010C00FC00EC044
-:100030000DC00CC00BC00AC009C008C011241FBEEF
-:10004000CFEFD1E0DEBFCDBF02D002C0D9CFFFCF0E
-:04005000F894FFCF52
+:100000001DC037C036C035C034C033C032C031C067
+:1000100030C02FC02EC02DC02CC02BC02AC029C07C
+:1000200028C027C026C025C024C023C022C021C0AC
+:1000300020C01FC01EC01DC01CC01BC011241FBE7D
+:10004000CFEFD1E0DEBFCDBF11E0A0E0B1E0EEE543
+:10005000F7E002C005900D92AE31B107D9F721E06B
+:10006000AEE1B1E001C01D92A832B207E1F759D06C
+:1000700074C3C6CFC09A2FE986E891E02150804032
+:100080009040E1F700C00000C09883E294EF019730
+:10009000F1F700C00000089580EC85B908959093B1
+:1000A00082008093810088E18093850086E08093C0
+:1000B000840082E08093860008959091860095FFE9
+:1000C000FCCF8093800008958091860087FFFCCF4D
+:1000D0008091800008959091860095FFFCCF8093D9
+:1000E000800080E090E00895D19A089520E030E00B
+:1000F0002817390749F0E9EFF0E03197F1F700C030
+:1001000000002F5F3F4FF4CF0895CF93DF93EC01B2
+:10011000D89AECDFD898CE0196958795DF91CF914C
+:10012000E5CF81E087BBB8DF8CE090E0B8DF80E00E
+:1001300091E09093250180932401CEE0D1E02E99A7
+:10014000FECF2E9A26B130E030932101209320017A
+:1001500087B190E06FEF70E017D0820F931F9093FC
+:100160001F0180931E018C979F938F93DF93CF93F2
+:100170001CD08BE792E90197F1F700C000000F90C7
+:100180000F900F900F90DBCF0024552704C0080E6E
+:10019000591F880F991F009729F076956795B8F336
+:1001A0007105B9F7802D952F0895A0E0B0E0EAED34
+:1001B000F0E0ACC2AE014B5F5F4FFA01619171910B
+:1001C000AF01809124019091250102D0E2E0BAC2F2
+:1001D000ABE0B0E0EDEEF0E089C26C017B018A019A
+:1001E000FC0117821682838181FFC0C1CE01019676
+:1001F0003C01F6019381F70193FD859193FF819175
+:100200007F01882309F4AEC1853239F493FD8591CD
+:1002100093FF81917F01853221F4B60190E0C1D135
+:10022000E8CF912C212C312CFFE1F315E0F08B323B
+:1002300079F038F4803279F08332A9F4232D2061EB
+:1002400010C08D3259F0803371F4232D216009C024
+:10025000832D8260382EE32DE46022C0F32DF860F8
+:1002600025C0322E27C037FC2DC020ED280F2A30A4
+:1002700088F436FE06C0892D6AE02FD2922E980EA1
+:1002800019C0822D6AE029D2222E280E832D806289
+:10029000382E10C08E3231F436FC64C1E32DE06498
+:1002A0003E2E08C08C3621F4F32DF0683F2E02C09C
+:1002B000883641F4F70193FD859193FF81917F0189
+:1002C0008111B2CF982F9F7D9554933028F40C5F05
+:1002D0001F4F2FE329830DC0833631F0833771F030
+:1002E000833509F055C020C0F801808189830E5FF5
+:1002F0001F4F88248394912C530112C02801F2E0EF
+:100300004F0E511CF801A080B18036FE03C0692D4C
+:1003100070E002C06FEF7FEFC50138D14C01820160
+:10032000F32DFF773F2E15C0280122E0420E511C0D
+:10033000F801A080B18036FE03C0692D70E002C0D4
+:100340006FEF7FEFC50117D14C01F32DF0683F2E01
+:10035000820133FC19C0822D90E088169906A0F422
+:10036000B60180E290E01DD12A94F5CFF50137FC6B
+:10037000859137FE81915F01B60190E012D1211085
+:100380002A9421E0821A91088114910479F7E1C03E
+:10039000843611F0893639F5F80137FE07C06081DF
+:1003A0007181828193810C5F1F4F08C060817181D0
+:1003B000072E000C880B990B0E5F1F4FF32DFF7655
+:1003C0003F2E97FF09C090958095709561957F4F5E
+:1003D0008F4F9F4FF0683F2E2AE030E0A3011DD1E0
+:1003E000882E861844C0853731F4232D2F7EB22EF7
+:1003F0002AE030E025C0932D997FB92E8F36C1F0C9
+:1004000018F4883579F0AEC0803719F0883721F0BC
+:10041000A9C0E92FE061BE2EB4FE0DC0FB2DF46033
+:10042000BF2E09C034FE0AC0292F2660B22E06C096
+:1004300028E030E005C020E130E002C020E132E0F9
+:10044000F801B7FE07C060817181828193810C5FE2
+:100450001F4F06C06081718180E090E00E5F1F4FEA
+:10046000A301DBD0882E8618FB2DFF773F2E36FEAA
+:100470000DC0232D2E7FA22E891458F434FE0BC0FC
+:1004800032FC09C0832D8E7EA82E05C0B82CA32C6B
+:1004900003C0B82C01C0B92CA4FE0FC0FE01E80DAA
+:1004A000F11D8081803321F49A2D997EA92E09C0F7
+:1004B000A2FE06C0B394B39404C08A2D867809F0D6
+:1004C000B394A3FC10C0A0FE06C0B21480F4280CA4
+:1004D000922C9B180DC0B21458F4B60180E290E043
+:1004E00060D0B394F8CFB21418F42B1802C0982C33
+:1004F000212CA4FE0FC0B60180E390E052D0A2FEF2
+:1005000016C0A1FC03C088E790E002C088E590E037
+:10051000B6010CC08A2D867851F0A1FE02C08BE294
+:1005200001C080E2A7FC8DE2B60190E03AD08914C8
+:1005300030F4B60180E390E034D09A94F8CF8A94F6
+:10054000F301E80DF11D8081B60190E02AD0811001
+:10055000F6CF222009F44DCEB60180E290E021D002
+:100560002A94F7CFF6018681978102C08FEF9FEF23
+:100570002B96E2E1D7C0FC0105906150704001105C
+:10058000D8F7809590958E0F9F1F0895FC016150BC
+:10059000704001900110D8F7809590958E0F9F1FA5
+:1005A00008950F931F93CF93DF93FB01238121FDC8
+:1005B00003C08FEF9FEF2CC022FF16C046815781EA
+:1005C000248135814217530744F4A081B1819D01F4
+:1005D0002F5F3F4F318320838C93268137812F5F9C
+:1005E0003F4F3783268314C08B01EC01FB0100844D
+:1005F000F185E02D0995892BE1F6D80116968D91AC
+:100600009C911797019617969C938E931697CE01FF
+:10061000DF91CF911F910F910895FA01AA272830F9
+:1006200061F1203191F1E8946F936E7F6E5F7F4F9F
+:100630008F4F9F4FAF4FB1E040D0B4E03ED0670F37
+:10064000781F891F9A1FA11D680F791F8A1F911D8E
+:10065000A11D6A0F711D811D911DA11D22D009F4DC
+:1006600068943F91062E000C3019000C000C3019D4
+:10067000305D3193CEF6CF010895462F4770405D2F
+:100680004193B3E00FD0C9F7F6CF462F4F70405DCE
+:100690004A3318F0495D31FD4052419302D0A9F729
+:1006A000EACFB4E0A6959795879577956795BA9523
+:1006B000C9F700976105710508959B01AC010A2EE9
+:1006C00006945795479537952795BA95C9F7620FC0
+:1006D000731F841F951FA01D0895002480FD060E22
+:1006E000660F11F08695D1F7802D08952F923F92D5
+:1006F0004F925F926F927F928F929F92AF92BF9232
+:10070000CF92DF92EF92FF920F931F93CF93DF93DD
+:10071000CDB7DEB7CA1BDB0B0FB6F894DEBF0FBE3A
+:10072000CDBF09942A88398848885F846E847D8487
+:100730008C849B84AA84B984C884DF80EE80FD8089
+:100740000C811B81AA81B981CE0FD11D0FB6F894FF
+:0E075000DEBF0FBECDBFED010895F894FFCFC0
+:10075E0000000003000000006B00000000003130BC
+:0E076E0020626974204144433A2025640A0049
:00000001FF
diff --git a/board/main.c b/board/main.c
index 3823f0e..7e9c3cd 100644
--- a/board/main.c
+++ b/board/main.c
@@ -1,16 +1,18 @@
#include "driver/usart.h"
-#include "driver/led.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("Should be sensor data: %d\n", adcStart());
- delay_ms(1000);
- }
- return 0;
+ while(1) {
+ while(ADCSRA & (1 << ADSC));
+ ADCSRA |= (1 << ADSC); // Start ADC conversion
+ // TODO: Must subtract ADCH from offset.
+ printf("PSI: %.2f\n", (ADCH / 255.0) * 14.5);
+ delay_ms(150);
+ }
}