From: <hoe...@us...> - 2009-04-13 03:21:40
|
Revision: 2792 http://reprap.svn.sourceforge.net/reprap/?rev=2792&view=rev Author: hoekstar Date: 2009-04-13 03:21:30 +0000 (Mon, 13 Apr 2009) Log Message: ----------- sorry adam, i hate using fancy features that fuck shit up. Modified Paths: -------------- trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/CircularBuffer.h trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/Timer1.h Modified: trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/CircularBuffer.h =================================================================== --- trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/CircularBuffer.h 2009-04-13 02:55:45 UTC (rev 2791) +++ trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/CircularBuffer.h 2009-04-13 03:21:30 UTC (rev 2792) @@ -38,17 +38,21 @@ /// Reset buffer. (Note: does not zero data.) void clear() { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { head = tail = 0; currentSize = 0; - } + //} + enableTimer1Interrupt(); } uint8_t operator[](uint16_t i) { uint16_t idx; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { idx = (i + tail) % capacity; - } + //} + enableTimer1Interrupt(); return buffer[idx]; } @@ -56,18 +60,22 @@ uint16_t remainingCapacity() { uint16_t remaining; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { remaining = (capacity - currentSize); - } + //} + enableTimer1Interrupt(); return remaining; } /// Get the current number of elements in the buffer. uint16_t size() { uint16_t csize; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { csize = currentSize; - } + //} + enableTimer1Interrupt(); return csize; } @@ -85,25 +93,31 @@ public: void append(uint8_t datum) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { appendInternal(datum); - } + //} + enableTimer1Interrupt(); } void append_16(uint16_t datum) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { appendInternal(datum & 0xff); appendInternal((datum >> 8) & 0xff); - } + //} + enableTimer1Interrupt(); } void append_32(uint32_t datum) { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { appendInternal(datum & 0xff); appendInternal((datum >> 8) & 0xff); appendInternal((datum >> 16) & 0xff); appendInternal((datum >> 24) & 0xff); - } + //} + enableTimer1Interrupt(); } private: @@ -123,28 +137,34 @@ /// Remove and return a character from the start of the /// circular buffer. uint8_t remove_8() { - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { return removeInternal(); - } + //} + enableTimer1Interrupt(); } uint16_t remove_16() { uint8_t v[2]; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { v[0] = removeInternal(); v[1] = removeInternal(); - } + //} + enableTimer1Interrupt(); return v[0] | ((uint16_t)v[1] << 8); } uint32_t remove_32() { uint8_t v[4]; - ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { + disableTimer1Interrupt(); + //ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { v[0] = removeInternal(); v[1] = removeInternal(); v[2] = removeInternal(); v[3] = removeInternal(); - } + //} + enableTimer1Interrupt(); return v[0] | ((uint32_t)v[1] << 8) | ((uint32_t)v[2] << 16) | Modified: trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/Timer1.h =================================================================== --- trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/Timer1.h 2009-04-13 02:55:45 UTC (rev 2791) +++ trunk/reprap/firmware/Sanguino/Sanguino3G/SanguinoMaster/Timer1.h 2009-04-13 03:21:30 UTC (rev 2792) @@ -12,8 +12,8 @@ inline void disableTimer1Interrupt() { - TIMSK1 &= ~(1<<ICIE1); TIMSK1 &= ~(1<<OCIE1A); +// TIMSK1 &= ~(1<<ICIE1); } inline void setTimer1Resolution(byte r) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |