This Hungarian company are developing an open source ECG device to be sold at a really low price, and have already open sourced their ECG analysis code.
Looks really interesting! http://mobilecg.hu/index.html
The source is here: https://github.com/xdever/MobilECG-II licenced under GPLv3