Permalink
Browse files

setting up new branch 2

  • Loading branch information...
triffid committed Aug 10, 2010
1 parent 994fa1b commit 595b66a341dcbe071e757442b70722c67da3f51f
Showing with 0 additions and 12,131 deletions.
  1. 0 {mendel → }/Makefile
  2. 0 {mendel → }/arduino.h
  3. +0 −75 battery_charger/Makefile
  4. +0 −56 battery_charger/adc.c
  5. +0 −23 battery_charger/adc.h
  6. +0 −69 battery_charger/battery_charger.c
  7. +0 −595 battery_charger/lcd.c
  8. +0 −263 battery_charger/lcd.h
  9. +0 −282 battery_charger/ld.strace
  10. +0 −89 battery_charger/ringbuffer.c
  11. +0 −26 battery_charger/ringbuffer.h
  12. +0 −72 battery_charger/serial.c
  13. +0 −24 battery_charger/serial.h
  14. 0 {mendel → }/calc.pl
  15. 0 {mendel → }/clock.c
  16. 0 {mendel → }/clock.h
  17. 0 {mendel → }/copier.c
  18. 0 {mendel → }/copier.h
  19. 0 {mendel → }/dda.c
  20. 0 {mendel → }/dda.h
  21. 0 {mendel → }/dda_queue.c
  22. 0 {mendel → }/dda_queue.h
  23. 0 {mendel → }/debug.c
  24. 0 {mendel → }/debug.h
  25. +0 −52 freq-counter/Makefile
  26. +0 −109 freq-counter/freq-counter.c
  27. +0 −595 freq-counter/lcd.c
  28. +0 −263 freq-counter/lcd.h
  29. BIN freq-counter/lcdlibrary.zip
  30. +0 −49 freq-counter/lcdlibrary/doxygen.css
  31. BIN freq-counter/lcdlibrary/doxygen.png
  32. +0 −1,174 freq-counter/lcdlibrary/group__pfleury__lcd.html
  33. +0 −609 freq-counter/lcdlibrary/lcd.c
  34. +0 −265 freq-counter/lcdlibrary/lcd.h
  35. +0 −425 freq-counter/lcdlibrary/makefile
  36. +0 −167 freq-counter/lcdlibrary/test_lcd.c
  37. +0 −89 freq-counter/ringbuffer.c
  38. +0 −26 freq-counter/ringbuffer.h
  39. +0 −72 freq-counter/serial.c
  40. +0 −24 freq-counter/serial.h
  41. BIN freq-counter/uartlibrary.zip
  42. +0 −49 freq-counter/uartlibrary/doxygen.css
  43. BIN freq-counter/uartlibrary/doxygen.png
  44. +0 −560 freq-counter/uartlibrary/group__pfleury__uart.html
  45. +0 −508 freq-counter/uartlibrary/makefile
  46. +0 −130 freq-counter/uartlibrary/test_uart.c
  47. +0 −651 freq-counter/uartlibrary/uart.c
  48. +0 −194 freq-counter/uartlibrary/uart.h
  49. 0 {mendel → }/func.sh
  50. 0 {mendel → }/gcode.c
  51. 0 {mendel → }/gcode.h
  52. 0 {mendel → }/machine.h
  53. 0 {mendel → }/mendel.c
  54. 0 {mendel → }/mendel_cmd
  55. 0 {mendel → }/pinout.h
  56. 0 {mendel → }/ringbuffer.c
  57. 0 {mendel → }/ringbuffer.h
  58. 0 {mendel → }/sender.sh
  59. 0 {mendel → }/serial.c
  60. 0 {mendel → }/serial.h
  61. 0 {mendel → }/sermsg.c
  62. 0 {mendel → }/sermsg.h
  63. 0 {mendel → }/sersendf.c
  64. 0 {mendel → }/sersendf.h
  65. +0 −76 skel/Makefile
  66. +0 −104 skel/arduino.h
  67. +0 −595 skel/lcd.c
  68. +0 −263 skel/lcd.h
  69. +0 −89 skel/ringbuffer.c
  70. +0 −26 skel/ringbuffer.h
  71. +0 −72 skel/serial.c
  72. +0 −26 skel/serial.h
  73. +0 −56 skel/yourprogramnamehere.c
  74. +0 −76 stepper-2/Makefile
  75. +0 −104 stepper-2/arduino.h
  76. +0 −595 stepper-2/lcd.c
  77. +0 −263 stepper-2/lcd.h
  78. +0 −89 stepper-2/ringbuffer.c
  79. +0 −26 stepper-2/ringbuffer.h
  80. +0 −72 stepper-2/serial.c
  81. +0 −24 stepper-2/serial.h
  82. +0 −302 stepper-2/stepper.c
  83. +0 −76 stepper/Makefile
  84. +0 −104 stepper/arduino.h
  85. +0 −595 stepper/lcd.c
  86. +0 −263 stepper/lcd.h
  87. +0 −89 stepper/ringbuffer.c
  88. +0 −26 stepper/ringbuffer.h
  89. +0 −72 stepper/serial.c
  90. +0 −24 stepper/serial.h
  91. +0 −396 stepper/stepper.c
  92. +0 −43 stepper/test.c
  93. 0 {mendel → }/temp.c
  94. 0 {mendel → }/temp.h
  95. 0 {mendel → }/timer.c
  96. 0 {mendel → }/timer.h
  97. 0 {mendel → }/watchdog.c
  98. 0 {mendel → }/watchdog.h
File renamed without changes.
File renamed without changes.
View
@@ -1,75 +0,0 @@
-##############################################################################
-# #
-# AVR-GCC skeleton #
-# #
-# by Triffid Hunter #
-# #
-##############################################################################
-
-##############################################################################
-# #
-# Change these to suit your application #
-# #
-##############################################################################
-
-PROGRAM = battery_charger
-
-SOURCES = $(PROGRAM).c ringbuffer.c serial.c lcd.c adc.c
-
-##############################################################################
-# #
-# Change these to suit your hardware #
-# #
-##############################################################################
-
-MCU_TARGET = atmega168
-F_CPU = 16000000L
-
-##############################################################################
-# #
-# These defaults should be ok, change if you need to #
-# #
-##############################################################################
-
-ARCH = avr-
-OPTIMIZE = -Os
-CFLAGS = -g -Wall -Wstrict-prototypes $(OPTIMIZE) -mmcu=$(MCU_TARGET) -DF_CPU=$(F_CPU) $(DEFS) -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
-LDFLAGS = -Wl,-u,vfprintf -lprintf_min
-
-CC = $(ARCH)gcc
-OBJDUMP = $(ARCH)objdump
-OBJCOPY = $(ARCH)objcopy
-AVRDUDE = ~/bin/avrdude
-
-PROGPORT = /dev/arduino
-PROGBAUD = 19200
-
-OBJ = $(patsubst %.c,%.o,${SOURCES})
-
-.PHONY: all program clean
-.PRECIOUS: %.o %.elf
-
-all: $(PROGRAM).hex $(PROGRAM).lst
-
-program: $(PROGRAM).hex
- stty $(PROGBAUD) raw ignbrk hup < $(PROGPORT)
- $(AVRDUDE) -cstk500v1 -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C/etc/avrdude.conf -U flash:w:$^
- stty -hup -echo < $(PROGPORT)
-
-clean:
- rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al
-
-%.o: %.c
- $(CC) -c $(CFLAGS) -Wa,-adhlns=$(<:.c=.al) -o $@ $^
-
-%.elf: $(OBJ)
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-%.lst: %.elf
- $(OBJDUMP) -h -S $< > $@
-
-%.hex: %.elf
- $(OBJCOPY) -j .text -j .data -O ihex $< $@
-
-%.bin: %.elf
- $(OBJCOPY) -j .text -j .data -O binary $< $@
View
@@ -1,56 +0,0 @@
-#include "adc.h"
-
-void adc_init(uint8_t vsel)
-{
- PRR &= ~_BV(PRADC);
- ADMUX = (ADMUX & ~(_BV(REFS1) | _BV(REFS0))) | vsel;
- ADCSRA = _BV(ADEN);
-
- #if F_CPU >= (ADC_MAX_FREQ * 128)
- #error F_CPU is too high for ADC prescaler!
- #elif F_CPU >= (ADC_MAX_FREQ * 64)
- ADCSRA |= _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0);
- #elif F_CPU >= (ADC_MAX_FREQ * 32)
- ADCSRA |= _BV(ADPS2) | _BV(ADPS1);
- #elif F_CPU >= (ADC_MAX_FREQ * 16)
- ADCSRA |= _BV(ADPS2) | _BV(ADPS0);
- #elif F_CPU >= (ADC_MAX_FREQ * 8)
- ADCSRA |= _BV(ADPS2);
- #elif F_CPU >= (ADC_MAX_FREQ * 4)
- ADCSRA |= _BV(ADPS1) | _BV(ADPS0);
- #elif F_CPU >= (ADC_MAX_FREQ * 2)
- ADCSRA |= _BV(ADPS1);
- #elif F_CPU >= (ADC_MAX_FREQ >> 1)
- ADSRA |= _BV(ADPS0);
- #else
- #error F_CPU is too slow for ADC to run well!
- #endif
-}
-
-uint16_t adc_read(uint8_t pin)
-{
- adc_start(pin);
- adc_wait();
- return adc_result();
-}
-
-void adc_start(uint8_t pin)
-{
- ADMUX = (ADMUX & 0xF0) | pin;
- ADCSRA |= _BV(ADSC);
-}
-
-uint16_t adc_result()
-{
- return ADC;
-}
-
-uint8_t adc_finished()
-{
- return (ADCSRA & _BV(ADSC))?0xFF:0;
-}
-
-void adc_wait()
-{
- for (;adc_finished() == 0;);
-}
View
@@ -1,23 +0,0 @@
-#ifndef _ADC_H
-#define _ADC_H
-
-#include <stdint.h>
-#include <avr/io.h>
-
-#define VSEL_AREF 0
-#define VSEL_AVCC _BV(REFS0)
-#define VSEL_1V1 _BV(REFS1)
-
-#define ADC_MAX_FREQ 200000
-
-void adc_init(uint8_t vsel);
-
-uint16_t adc_read(uint8_t pin);
-
-void adc_start(uint8_t pin);
-inline uint16_t adc_result(void);
-
-uint8_t adc_finished(void);
-void adc_wait(void);
-
-#endif /* _ADC_H */
@@ -1,69 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-#include <stdint.h>
-
-#include <avr/io.h>
-#include <avr/interrupt.h>
-
-#include "serial.h"
-#include "lcd.h"
-
-// write to lcd function for fdev_setup_stream
-static int lcd_putc_fdev(char c, FILE *stream)
-{
- lcd_putc(c);
- return 0;
-}
-
-int serial_putc_fdev(char c, FILE *stream)
-{
- serial_writechar((uint8_t) c);
- return 0;
-}
-
-int serial_getc_fdev(FILE *stream)
-{
- for (;serial_rxchars() == 0;);
- return (int) serial_popchar();
-}
-
-static FILE lcdo = FDEV_SETUP_STREAM(lcd_putc_fdev, NULL, _FDEV_SETUP_WRITE);
-static FILE serio = FDEV_SETUP_STREAM(serial_putc_fdev, serial_getc_fdev, _FDEV_SETUP_RW);
-
-int main (void)
-{
- // set up LCD
- lcd_init(LCD_DISP_ON_CURSOR);
-
- lcd_puts_P("Starting...");
-
- // set up STDIN/OUT/ERR
- stdin = &serio;
- stdout = &lcdo;
- stderr = &lcdo;
-
- // set up serial
- serial_init(19200);
-
- sei();
-
- lcd_gotoxy(0, 0);
- fprintf(&lcdo, "Battery Charger OK");
-
- for (;;)
- {
- # switch off all currents
- # check battery presence
- # for (each battery) {
- # check ambient temperature
- # check battery temperature
- # calculate delta T
- # check battery voltage
- # calculate delta V
- # check charge cycle location
- # apply suitable current
- # update screen/indicators
- # }
- # wait
- }
-}
Oops, something went wrong.

0 comments on commit 595b66a

Please sign in to comment.