-- fixes for pins (The TXD set function now sets it to negative, instead of positive), same goes for the CTS pin
{
int i;
for(i = 7; i >= 0; i--) {
- if(b & (1 << i)) SetMOSI();
- else ClearMOSI();
+ if(b & (1 << i)) ClearMOSI();
+ else SetMOSI();
waitmicrosec(2);
SetSCK();
waitmicrosec(3);
{
deactivate();
ClearSCK();
- ClearMOSI();
+ SetMOSI();
SetRST();
waitmillisec(12);
static struct bit bits[] = {
{ 4, 0x02, 0}, /* RTS */
- { 3, 0x40, 1}, /* TXD */
+ { 3, 0x40, 0}, /* TXD */
{ 6, 0x10, 1}, /* CTS */
{ 6, 0x20, 0}, /* DSR */
{ 4, 0x01, 0}, /* DTR */
switch(p) {
case SER_PIN_TXD:
- if(ioctl (fd, TIOCCBRK, 0) < 0) perror("ioctl");
+ if(ioctl (fd, TIOCSBRK, 0) < 0) perror("ioctl");
break;
case SER_PIN_DTR: status |= TIOCM_DTR; break;
case SER_PIN_DSR: status |= TIOCM_LE; break;
switch(p) {
case SER_PIN_TXD:
- if(ioctl (fd, TIOCSBRK, 0) < 0) perror("ioctl");
+ if(ioctl (fd, TIOCCBRK, 0) < 0) perror("ioctl");
break;
case SER_PIN_DTR: status &=~TIOCM_DTR; break;
case SER_PIN_DSR: status &=~TIOCM_LE; break;
int i;
if(!backend) backend = pins_backends[0];
for(i = 0; i < num_confsettings; i++) {
- SetPinVariable(confsettings[i].name, confsettings[i].value);
+ switch(SetPinVariable(confsettings[i].name, confsettings[i].value)) {
+ case 0:break;
+ case -1:
+ fprintf(stderr, "Unknown PIN '%s'\n", confsettings[i].name);
+ return -1;
+ case -2:
+ fprintf(stderr, "Unknown PIN '%s'\n", confsettings[i].value);
+ return -1;
+ }
}
return backend->init(location);
#include "at89ser.h"
#include "delays.h"
-#define VERSION "0.6"
+#define VERSION "0.7"
char progress = 0;