summaryrefslogtreecommitdiff
path: root/2.3-1/src/c
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c')
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h1
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h6
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h13
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h23
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h3
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h9
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h4
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h8
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h3
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h7
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h3
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h15
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h6
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h5
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h11
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h2
-rw-r--r--2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c4
-rw-r--r--2.3-1/src/c/matrixOperations/toeplitz/ctoeplitza.c6
-rw-r--r--2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c6
-rw-r--r--2.3-1/src/c/signalProcessing/%k/dmodka.c25
-rw-r--r--2.3-1/src/c/signalProcessing/%sn/dmodsns.c10
-rw-r--r--2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c2
-rw-r--r--2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c11
-rw-r--r--2.3-1/src/c/signalProcessing/ffilt/gffilts.c9
-rw-r--r--2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c2
-rw-r--r--2.3-1/src/c/signalProcessing/sincd/dsincds.c1
-rw-r--r--2.3-1/src/c/signalProcessing/sincd/u8sincds.c5
-rw-r--r--2.3-1/src/c/signalProcessing/zmodsns.c161
-rw-r--r--2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c1
-rw-r--r--2.3-1/src/c/string/ascii/gasciia.c4
-rw-r--r--2.3-1/src/c/string/includes/ascii.h2
-rw-r--r--2.3-1/src/c/string/strcspn/gstrcspna.c6
32 files changed, 317 insertions, 57 deletions
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h
index 096fed08..6b7ed271 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h
@@ -28,6 +28,7 @@ extern "C" {
#define d0d0RPI_digitalWrite(pin,state) u8RPI_digitalWrites(pin,state);
#define u80RPI_digitalWriteByte(value) u8RPI_digitalWriteBytes(value);
+#define d0RPI_digitalWriteByte(value) u8RPI_digitalWriteBytes(value);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h
index cea8bb6e..e258068c 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralGertboard.h
@@ -21,9 +21,15 @@ extern "C" {
#endif
#define RPI_gertboardSPISetupi80() RPI_gertboardSPISetup();
+
#define u160RPI_gertboardAnalogSetupi80(pinBase) u16RPI_gertboardAnalogSetups(pinBase);
+#define d0RPI_gertboardAnalogSetupi80(pinBase) u16RPI_gertboardAnalogSetups(pinBase);
+
#define u160RPI_gertboardAnalogReadu160(pin) u160RPI_gertboardAnalogReads(pin);
+#define d0RPI_gertboardAnalogReadu160(pin) u160RPI_gertboardAnalogReads(pin);
+
#define u160u160RPI_gertboardAnalogWrite(pin,value) u160RPI_gertboardAnalogWrites(pin,value);
+#define d0d0RPI_gertboardAnalogWrite(pin,value) u160RPI_gertboardAnalogWrites(pin,value);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h
index f18fd57c..b93529e3 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralI2C.h
@@ -21,12 +21,25 @@ extern "C" {
#endif
#define u160RPI_I2CSetupi80(arrd) u16RPI_I2CSetups(arrd);
+#define d0RPI_I2CSetupi80(arrd) u16RPI_I2CSetups(arrd);
+
#define u160RPI_I2CReadi80(fd) u16RPI_I2CReads(fd);
+#define d0RPI_I2CReadi80(fd) u16RPI_I2CReads(fd);
+
#define u160u160RPI_I2CReadReg8i80(fd,reg) u16RPI_I2CReadReg8s(fd,reg);
+#define d0d0RPI_I2CReadReg8i80(fd,reg) u16RPI_I2CReadReg8s(fd,reg);
+
#define u160u160RPI_I2CReadReg16i80(fd,reg) u16RPI_I2CReadReg16s(fd,reg);
+#define d0d0RPI_I2CReadReg16i80(fd,reg) u16RPI_I2CReadReg16s(fd,reg);
+
#define u160u160RPI_I2CWritei80(fd,data) u16RPI_I2CWrites(fd,data);
+#define d0d0RPI_I2CWritei80(fd,data) u16RPI_I2CWrites(fd,data);
+
#define u160u160u160RPI_I2CWriteReg8i80(fd,reg,data) u16RPI_I2CWriteReg8s(fd,reg,data);
+#define d0d0d0RPI_I2CWriteReg8i80(fd,reg,data) u16RPI_I2CWriteReg8s(fd,reg,data);
+
#define u160u160u160RPI_I2CWriteReg16i80(fd,reg,data) u16RPI_I2CWriteReg16s(fd,reg,data);
+#define d0d0d0RPI_I2CWriteReg16i80(fd,reg,data) u16RPI_I2CWriteReg16s(fd,reg,data);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h
index e4f3ca29..e6dcb7db 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD.h
@@ -21,17 +21,40 @@ extern "C" {
#endif
#define u80u80u80u80u80u80u80u80u80u80RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7);
+#define d0d0d0d0d0d0d0d0d0d0RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdCharDefs(fd,index,d0,d1,d2,d3,d4,d5,d6,d7);
+
#define u80RPI_lcdClear(fd) u8RPI_lcdClears(fd);
+#define d0RPI_lcdClear(fd) u8RPI_lcdClears(fd);
+
#define u80u80RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state);
+#define d0d0RPI_lcdCursorBlink(fd,state) u8RPI_lcdCursorBlinks(fd,state);
+
#define u80u80RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state);
+#define d0d0RPI_lcdCursor(fd,state) u8RPI_lcdCursors(fd,state);
+
#define u80u80RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state);
+#define d0d0RPI_lcdDisplay(fd,state) u8RPI_lcdDisplays(fd,state);
+
#define u80RPI_lcdHome(fd) u8RPI_lcdHomes(fd);
+#define d0RPI_lcdHome(fd) u8RPI_lcdHomes(fd);
+
#define u80u80u80u80u80u80u80u80u80u80u80u80u80RPI_lcdIniti80(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdInits(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7);
+#define d0d0d0d0d0d0d0d0d0d0d0d0d0RPI_lcdIniti80(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7) u8RPI_lcdInits(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7);
+
#define u80u80u80RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col);
+#define d0d0d0RPI_lcdPosition(fd,row,col) u8RPI_lcdPositions(fd,row,col);
+
#define u80u80RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char);
+#define d0d0RPI_lcdPutchar(fd,char) u8RPI_lcdPutchars(fd,char);
+
#define u80u80RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd);
+#define d0d0RPI_lcdSendCommand(fd,cmd) u8RPI_lcdSendCommands(fd,cmd);
+
#define u80g2RPI_lcdPuts(fd,msg,size) u8RPI_lcdPutss(fd,msg,size[1]);;
+#define d0g2RPI_lcdPuts(fd,msg,size) u8RPI_lcdPutss(fd,msg,size[1]);;
+
#define u80g2RPI_lcdPrintf(fd,data,size) u8RPI_lcdPrintfs(fd,data,size[1]);
+#define d0g2RPI_lcdPrintf(fd,data,size) u8RPI_lcdPrintfs(fd,data,size[1]);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h
index 46b63286..77cc433c 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralLCD128x64.h
@@ -38,8 +38,10 @@ extern "C" {
#define u80u80u80u80u80RPI_lcd128x64line(x0,y0,x1,y1,colour) u8RPI_lcd128x64lines(x0,y0,x1,y1,colour);
#define d0d0d0d0d0RPI_lcd128x64line(x0,y0,x1,y1,colour) u8RPI_lcd128x64lines(x0,y0,x1,y1,colour);
+
#define u80u80u80u80u80RPI_lcd128x64circle(x,y,r,colour,filled) u8RPI_lcd128x64circles(x,y,r,colour,filled);
#define d0d0d0d0d0RPI_lcd128x64circle(x,y,r,colour,filled) u8RPI_lcd128x64circles(x,y,r,colour,filled);
+
#define u80u80u80u80u80RPI_lcd128x64putchar(x,y,c,bgCol,fgCol) u8RPI_lcd128x64putchars(x,y,c,bgCol,fgCol);
#define d0d0d0d0u80RPI_lcd128x64putchar(x,y,c,bgCol,fgCol) u8RPI_lcd128x64putchars(x,y,c,bgCol,fgCol);
@@ -48,6 +50,7 @@ extern "C" {
#define u80u80u80u80u80u80RPI_lcd128x64rectangle(x1,y1,x2,y2,colour,filled) u8RPI_lcd128x64rectangles(x1,y1,x2,y2,colour,filled);
#define d0d0d0d0d0d0RPI_lcd128x64rectangle(x1,y1,x2,y2,colour,filled) u8RPI_lcd128x64rectangles(x1,y1,x2,y2,colour,filled);
+
#define u80u80u80u80u80u80RPI_lcd128x64ellipse(cx,cy,xRadius,yRadius,colour,filled) u8RPI_lcd128x64ellipses(cx,cy,xRadius,yRadius,colour,filled);
#define d0d0d0d0d0d0RPI_lcd128x64ellipse(cx,cy,xRadius,yRadius,colour,filled) u8RPI_lcd128x64ellipses(cx,cy,xRadius,yRadius,colour,filled);
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h
index c044cf7f..7857b3ae 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMcp.h
@@ -21,10 +21,19 @@ extern "C" {
#endif
#define u160u80RPI_mcp23008Setupu80(pinBase,addr) u16RPI_mcp23008Setups(pinBase,addr);
+#define d0d0RPI_mcp23008Setupu80(pinBase,addr) u16RPI_mcp23008Setups(pinBase,addr);
+
#define u160u80RPI_mcp23016Setupu80(pinBase,addr) u16RPI_mcp23016Setups(pinBase,addr);
+#define d0d0RPI_mcp23016Setupu80(pinBase,addr) u16RPI_mcp23016Setups(pinBase,addr);
+
#define u160u80RPI_mcp23017Setupu80(pinBase,addr) u16RPI_mcp23017Setups(pinBase,addr);
+#define d0d0RPI_mcp23017Setupu80(pinBase,addr) u16RPI_mcp23017Setups(pinBase,addr);
+
#define u160u80u80RPI_mcp23s08Setupu80(pinBase,spiport,devId) u16RPI_mcp23s08Setups(pinBase,spiport,devId);
+#define d0d0d0RPI_mcp23s08Setupu80(pinBase,spiport,devId) u16RPI_mcp23s08Setups(pinBase,spiport,devId);
+
#define u160u80u80RPI_mcp23s17Setupu80(pinBase,spiport,devId) u16RPI_mcp23s17Setups(pinBase,spiport,devId);
+#define d0d0d0RPI_mcp23s17Setupu80(pinBase,spiport,devId) u16RPI_mcp23s17Setups(pinBase,spiport,devId);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h
index b836d683..de065a24 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralMisc.h
@@ -21,8 +21,12 @@ extern "C" {
#endif
#define RPI_boardRevu80() RPI_boardRev();
+
#define u80u80RPI_padDrive(group,strength) u8RPI_padDrives(group,strength);
+#define d0d0RPI_padDrive(group,strength) u8RPI_padDrives(group,strength);
+
#define u160RPI_sn3218Setupi80(pinBase) u16RPI_sn3218Setups(pinBase);
+#define d0RPI_sn3218Setupi80(pinBase) u16RPI_sn3218Setups(pinBase);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h
index 49c58c04..fd1a1b08 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPWM.h
@@ -21,10 +21,18 @@ extern "C" {
#endif
#define u80u160RPI_pwmWrite(pin,value) u8RPI_pwmWrites(pin,value);
+#define d0d0RPI_pwmWrite(pin,value) u8RPI_pwmWrites(pin,value);
+
#define u320RPI_pwmRange(value) u32RPI_pwmRanges(value);
+#define d0RPI_pwmRange(value) u32RPI_pwmRanges(value);
+
#define g2RPI_pwmMode(mode) gRPI_pwmModea(mode);
+
#define u160RPI_pwmClock(divisor) u16RPI_pwmClocks(divisor);
+#define d0RPI_pwmClock(divisor) u16RPI_pwmClocks(divisor);
+
#define u80u160RPI_pwmToneWrite(pin,value) u8RPI_pwmToneWrites(pin,value);
+#define d0d0RPI_pwmToneWrite(pin,value) u8RPI_pwmToneWrites(pin,value);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h
index e3d2009d..3d0cb273 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPcf.h
@@ -21,7 +21,10 @@ extern "C" {
#endif
#define u160u80RPI_pcf8574Setupu80(pinBase,addr) u16RPI_pcf8574Setups(pinBase,addr);
+#define d0d0RPI_pcf8574Setupu80(pinBase,addr) u16RPI_pcf8574Setups(pinBase,addr);
+
#define u160u80RPI_pcf8591Setupu80(pinBase,addr) u16RPI_pcf8591Setups(pinBase,addr);
+#define d0d0RPI_pcf8591Setupu80(pinBase,addr) u16RPI_pcf8591Setups(pinBase,addr);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h
index 08056f94..8e268f6e 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPiGlow.h
@@ -21,9 +21,16 @@ extern "C" {
#endif
#define u80RPI_piGlowSetup(clear) u8RPI_piGlowSetups(clear);
+#define d0RPI_piGlowSetup(clear) u8RPI_piGlowSetups(clear);
+
#define u80u80u80RPI_piGlow1(leg,ring,intensity) u8RPI_piGlow1s(leg,ring,intensity);
+#define d0d0d0RPI_piGlow1(leg,ring,intensity) u8RPI_piGlow1s(leg,ring,intensity);
+
#define u80u80RPI_piGlowLeg(leg,intensity) u8RPI_piGlowLegs(leg,intensity);
+#define d0d0RPI_piGlowLeg(leg,intensity) u8RPI_piGlowLegs(leg,intensity);
+
#define u80u80RPI_piGlowRing(ring,intensity) u8RPI_piGlowRings(ring,intensity);
+#define d0d0RPI_piGlowRing(ring,intensity) u8RPI_piGlowRings(ring,intensity);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h
index 39c5c011..8de0dc29 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralPinMap.h
@@ -21,7 +21,10 @@ extern "C" {
#endif
#define u80RPI_physToGpioi80(pin) u8RPI_physToGpios(pin);
+#define d0RPI_physToGpioi80(pin) u8RPI_physToGpios(pin);
+
#define u80RPI_wpiToGpioi80(pin) u8RPI_wpiToGpios(pin);
+#define d0RPI_wpiToGpioi80(pin) u8RPI_wpiToGpios(pin);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h
index e0832f97..b308d838 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSerial.h
@@ -21,13 +21,28 @@ extern "C" {
#endif
#define g2u320RPI_serialOpeni80(device,size,baud) gRPI_serialOpena(device,size[1],baud);
+#define g2d0RPI_serialOpeni80(device,size,baud) gRPI_serialOpena(device,size[1],baud);
+
#define u80RPI_serialClose(fd) u8RPI_serialCloses(fd);
+#define d0RPI_serialClose(fd) u8RPI_serialCloses(fd);
+
#define u80RPI_serialDataAvailu80(fd) u8RPI_serialDataAvails(fd);
+#define d0RPI_serialDataAvailu80(fd) u8RPI_serialDataAvails(fd);
+
#define u80RPI_serialFlush(fd) u8RPI_serialFlushs(fd);
+#define d0RPI_serialFlush(fd) u8RPI_serialFlushs(fd);
+
#define u80RPI_serialGetcharg2(fd,out) u8RPI_serialGetchars(fd,out);
+#define d0RPI_serialGetcharg2(fd,out) u8RPI_serialGetchars(fd,out);
+
#define u80g2RPI_serialPrintf(fd,msg,size) u8RPI_serialPrintfs(fd,msg,size[1]);
+#define d0g2RPI_serialPrintf(fd,msg,size) u8RPI_serialPrintfs(fd,msg,size[1]);
+
#define u80u80RPI_serialPutchar(fd,character) u8RPI_serialPutchars(fd,character);
+#define d0d0RPI_serialPutchar(fd,character) u8RPI_serialPutchars(fd,character);
+
#define u80g2RPI_serialPutsg2(fd,character,size) u8RPI_serialPutss(fd,character,size[1]);
+#define d0g2RPI_serialPutsg2(fd,character,size) u8RPI_serialPutss(fd,character,size[1]);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h
index bd82702d..6bcb1632 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSetup.h
@@ -23,18 +23,12 @@ extern "C" {
#define g2RPI_pinNumberingi80(seq,size) gRPI_pinNumberinga(seq,size[1]);
//getAlt
#define u80RPI_getAltu80(pin) u8RPI_getAlts(pin);
-#define u160RPI_getAltu80(pin) u8RPI_getAlts(pin);
-#define u320RPI_getAltu80(pin) u8RPI_getAlts(pin);
#define d0RPI_getAltu80(pin) u8RPI_getAlts(pin);
//pinModeAlt
#define u80u80RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode);
-#define u160u160RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode);
-#define u320u320RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode);
#define d0d0RPI_pinModeAlt(pin,mode) u8RPI_pinModeAlts(pin,mode);
//pinMode
#define u80g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]);
-#define u160g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]);
-#define u320g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]);
#define d0g2RPI_pinMode(pin,mode,size) u8RPI_pinModes(pin,mode,size[1]);
//pullControl
#define u80g2RPI_pullControl(pin,mode,size) u8RPI_pullControls(pin,mode,size[1]);
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h
index 6b142bd5..7b70ce9a 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralShift.h
@@ -21,8 +21,13 @@ extern "C" {
#endif
#define u80u80u80RPI_shiftInu80(dpin,cpin,order) u8RPI_shiftIns(dpin,cpin,order);
+#define d0d0d0RPI_shiftInu80(dpin,cpin,order) u8RPI_shiftIns(dpin,cpin,order);
+
#define u80u80u80u80RPI_shiftOut(dpin,cpin,order,val) u8RPI_shiftOuts(dpin,cpin,order,val);
+#define d0d0d0d0RPI_shiftOut(dpin,cpin,order,val) u8RPI_shiftOuts(dpin,cpin,order,val);
+
#define u160u80u80u80u80RPI_sr595Setupi80(pinBase,nPins,dP,cP,lP) u16RPI_sr595Setups(pinBase,nPins,dP,cP,lP);
+#define d0d0d0d0d0RPI_sr595Setupi80(pinBase,nPins,dP,cP,lP) u16RPI_sr595Setups(pinBase,nPins,dP,cP,lP);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h
index 80372b26..646c5244 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralSoft.h
@@ -21,11 +21,22 @@ extern "C" {
#endif
#define u80u160u160RPI_softPwmCreateu80(pin,ival,range) u8RPI_softPwmCreates(pin,ival,range);
+#define d0d0d0RPI_softPwmCreateu80(pin,ival,range) u8RPI_softPwmCreates(pin,ival,range);
+
#define u80RPI_softPwmStop(pin) u8RPI_softPwmStops(pin);
+#define d0RPI_softPwmStop(pin) u8RPI_softPwmStops(pin);
+
#define u80u160RPI_softPwmWrite(pin,value) u8RPI_softPwmWrites(pin,value);
+#define d0d0RPI_softPwmWrite(pin,value) u8RPI_softPwmWrites(pin,value);
+
#define u80RPI_softToneCreateu80(pin) u8RPI_softToneCreates(pin);
+#define d0RPI_softToneCreateu80(pin) u8RPI_softToneCreates(pin);
+
#define u80RPI_softToneStop(pin) u8RPI_softToneStops(pin);
+#define d0RPI_softToneStop(pin) u8RPI_softToneStops(pin);
+
#define u80u320RPI_softToneWrite(pin,value) u8RPI_softToneWrites(pin,value);
+#define d0d0RPI_softToneWrite(pin,value) u8RPI_softToneWrites(pin,value);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h
index d2fae234..cbbb47ae 100644
--- a/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h
+++ b/2.3-1/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralTiming.h
@@ -24,6 +24,8 @@ extern "C" {
#define d0RPI_delay(time) u32RPI_delays(time);
#define u320RPI_delayMicro(time) u32RPI_delayMicros(time);
+#define d0RPI_delayMicro(time) u32RPI_delayMicros(time);
+
#define RPI_millisu320() RPI_millis();
#define RPI_microsu320() RPI_micros();
diff --git a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c
index fe1b8cd2..3fe0c828 100644
--- a/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c
+++ b/2.3-1/src/c/hardware/rasberrypi/pwm/u8RPI_pwmToneWrites.c
@@ -12,6 +12,6 @@
#include "RPIPeripheralPWM.h"
-void u8RPI_pwmToneWrites(uint8 pin, uint16 value){
- pwmToneWrite(pin, value);
+void u8RPI_pwmToneWrites(uint8 pin,uint16 freq){
+ pwmToneWrite(pin,freq);
}
diff --git a/2.3-1/src/c/matrixOperations/toeplitz/ctoeplitza.c b/2.3-1/src/c/matrixOperations/toeplitz/ctoeplitza.c
index 048a367a..56c3ef84 100644
--- a/2.3-1/src/c/matrixOperations/toeplitz/ctoeplitza.c
+++ b/2.3-1/src/c/matrixOperations/toeplitz/ctoeplitza.c
@@ -9,14 +9,14 @@
void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatComplex* oup)
{
- if (inp1[0]!=inp2[0])
+ if ((creals(inp1[0])!=creals(inp2[0]))&&(cimags(inp1[0])!=cimags(inp2[0])))
{
printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz.
return;
}
int i, j;
- for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros.
+ for(i=0;i<size1*size2;i++) oup[i] = FloatComplex(0,0); // Initializing the output matrix with zeros.
for (i = 0; i<size1; i++)
{
@@ -28,7 +28,7 @@ void ctoeplitza(floatComplex* inp1,int size1,floatComplex* inp2,int size2,floatC
}
for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix.
{
- if (oup[i] == 0)
+ if (creals(oup[i]) == 0 && cimags(oup[i]) == 0)
oup[i] = oup[i-size2-1];
}
}
diff --git a/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c b/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c
index d47c5e15..117f8189 100644
--- a/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c
+++ b/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c
@@ -11,14 +11,14 @@
void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup)
{
- if (inp1[0]!=inp2[0])
+ if ((zreals(inp1[0])!=zreals(inp2[0]))&&(zimags(inp1[0])!=zimags(inp2[0])))
{
printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz.
return;
}
int i, j;
- for(i=0;i<size1*size2;i++) oup[i] = DoubleComplex(0,0); // Initializing the output matrix with zeros.
+ for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros.
for (i = 0; i<size1; i++)
{
@@ -30,7 +30,7 @@ void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doub
}
for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix.
{
- if (oup[i] == DoubleComplex(0,0))
+ if (zreals(oup[i]) == 0 && zimags(oup[i]) == 0)
oup[i] = oup[i-size2-1];
}
}
diff --git a/2.3-1/src/c/signalProcessing/%k/dmodka.c b/2.3-1/src/c/signalProcessing/%k/dmodka.c
index c0630ec0..8368cb6b 100644
--- a/2.3-1/src/c/signalProcessing/%k/dmodka.c
+++ b/2.3-1/src/c/signalProcessing/%k/dmodka.c
@@ -1,3 +1,14 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
#include<stdio.h>
#include<math.h>
#include "modk.h"
@@ -10,7 +21,6 @@ double max_calc(double* ptr,int sz)
ptr[0]=-1*ptr[0];
}
mx=(ptr[0]);
- //printf("%lf\n",mx);
for(i=1;i<sz;i++)
{
if(ptr[i]<0)
@@ -47,10 +57,7 @@ void dmodka(double* inp,int size,double* oup)
c[l]=sqrt(inp[l]);
}
- int x=0;
- //double maxi;
- //maxi=max_calc(c,size);
- //printf("%lf",maxi);
+ int x=0;
while(max_calc(c,size)>eps)
{
@@ -88,10 +95,4 @@ void dmodka(double* inp,int size,double* oup)
}
}
-/*
-int main()
-{
- double m[3]={0.1,0.2,0.3};
- dka(m,3);
-}
-*/
+
diff --git a/2.3-1/src/c/signalProcessing/%sn/dmodsns.c b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c
index 06d0a6f0..aae16c19 100644
--- a/2.3-1/src/c/signalProcessing/%sn/dmodsns.c
+++ b/2.3-1/src/c/signalProcessing/%sn/dmodsns.c
@@ -82,12 +82,4 @@ double dmodsns(double uu, double emmc)
}
return sn;
}
-/*
-int main()
-{
- double u,k;
- u=4;
- k=0.7;
- sn(u,k);
-}
-*/
+
diff --git a/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c
index 9af0c8e8..58ef3035 100644
--- a/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c
+++ b/2.3-1/src/c/signalProcessing/ell1mag/dell1maga.c
@@ -21,7 +21,7 @@ void dell1maga(double eps,double m1,double* z,int size,double* oup )
int i;
for(i=0;i<size;i++)
{
- s[i]=zmodsns(z[i],m1);
+ s[i]=dmodsns(z[i],m1);
}
double un[size];
int j;
diff --git a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
index 6e7a6f93..35b49281 100644
--- a/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
+++ b/2.3-1/src/c/signalProcessing/ell1mag/zell1maga.c
@@ -14,6 +14,9 @@
#include "modsn.h"
#include "ell1mag.h"
#include "doubleComplex.h"
+#include "multiplication.h"
+#include "addition.h"
+#include "division.h"
void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
{
@@ -31,9 +34,15 @@ void zell1maga(double eps,double m1,doubleComplex* z,int size,double* oup )
}
doubleComplex v;
int k;
+ double ml;
+ ml=eps*eps;
+ doubleComplex tp1,tp2,tp3;
for(k=0;k<size;k++)
{
- v=un[k]/(un[k]+(eps*eps*s[k]*s[k]));
+ tp1=zmuls(s[k],s[k]);
+ tp2=DoubleComplex(ml,0);
+ tp3=DoubleComplex(un[k],0);
+ v=zrdivs(tp3,zadds(tp3,(zmuls(tp2,tp1))));
oup[k]=zreals(v);
}
}
diff --git a/2.3-1/src/c/signalProcessing/ffilt/gffilts.c b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c
index 538daf3e..09876d00 100644
--- a/2.3-1/src/c/signalProcessing/ffilt/gffilts.c
+++ b/2.3-1/src/c/signalProcessing/ffilt/gffilts.c
@@ -80,11 +80,4 @@ void gffilts(char* ft,int size,double N,double fc,double fh,double* oup)
oup[id]=1+oup[id];
}
}
-/*
-int main()
-{
- string s;
- int n;
- double fl,fh;
-}
-*/
+
diff --git a/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c
index d2079f4d..e44f464e 100644
--- a/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c
+++ b/2.3-1/src/c/signalProcessing/fsfirlin/dfsfirlina.c
@@ -11,11 +11,9 @@
*/
#include<stdio.h>
-
#include<math.h>
#include "sincd.h"
#include "fsfirlin.h"
-//#define PI 3.14159265358979
void dfsfirlina(double* hd,int size,double flag,double* hst)
{
diff --git a/2.3-1/src/c/signalProcessing/sincd/dsincds.c b/2.3-1/src/c/signalProcessing/sincd/dsincds.c
index 1475d8de..c9f2f815 100644
--- a/2.3-1/src/c/signalProcessing/sincd/dsincds.c
+++ b/2.3-1/src/c/signalProcessing/sincd/dsincds.c
@@ -13,7 +13,6 @@
#include<stdio.h>
#include<math.h>
#include "sincd.h"
-//#define PI 3.14159265358979
void dsincds(double n,double flg,double* oup)
{
double npt=4*n;
diff --git a/2.3-1/src/c/signalProcessing/sincd/u8sincds.c b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c
index d03f48ae..ff0a2acc 100644
--- a/2.3-1/src/c/signalProcessing/sincd/u8sincds.c
+++ b/2.3-1/src/c/signalProcessing/sincd/u8sincds.c
@@ -13,12 +13,11 @@
#include<stdio.h>
#include<math.h>
#include "sincd.h"
-#define PI 3.14159265358979
void u8sincds(int n,int flg,double* oup)
{
double npt=4*n;
int sz=4*n;
- double pas=PI/npt;
+ double pas=M_PI/npt;
double om[sz+1];
int i;
//om[0]=0;
@@ -69,7 +68,7 @@ void u8sincds(int n,int flg,double* oup)
int a;
for(a=0;a<=4*n;a++)
{
- om[a]=om[a]-(PI/(2*n));
+ om[a]=om[a]-(M_PI/(2*n));
}
int j,k;
for(j=0;j<=4*n;j++)
diff --git a/2.3-1/src/c/signalProcessing/zmodsns.c b/2.3-1/src/c/signalProcessing/zmodsns.c
new file mode 100644
index 00000000..5f35059f
--- /dev/null
+++ b/2.3-1/src/c/signalProcessing/zmodsns.c
@@ -0,0 +1,161 @@
+/* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Ankit Raj
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ Reference:- Abramowitz, Milton and Stegun, Irene A
+ Handbook of Mathematical Functions, Dover, 1965
+ Chapter 16 (Sections 16.4, 16.13 and 16.15)
+ Link for FORTRAN code:-http://www.aip.de/groups/soe/local/numres/bookfpdf/f6-11.pdf
+*/
+
+#include<stdio.h>
+#include<math.h>
+#include "modsn.h"
+#include "doubleComplex.h"
+#define CA 0.0003
+
+doubleComplex zmodsns(doubleComplex uu,double emmc)
+{
+ doubleComplex ans;
+ double uur,uui;
+ uur=zreals(uu);
+ uui=zimags(uu);
+ double sr,cr,dr;
+ //Performing Elliptic Function operation for the real values
+ double a1,b1,c1,d1,emc1,u1;
+ double em1[14],en1[14];
+ int i1,ii1,l1,bo1;
+ emc1=1-emmc;
+ u1=uur;
+ if(emc1)
+ {
+ bo1=(emc1<0.0);
+ if(bo1)
+ {
+ d1=1.0-emc1;
+ emc1/=-1.0/d1;
+ u1*=(d1=sqrt(d1));
+ }
+ a1=1.0;
+ dr=1.0;
+ for(i1=1;i1<=13;i1++)
+ {
+ l1=i1;
+ em1[i1]=a1;
+ en1[i1]=(emc1=sqrt(emc1));
+ c1=0.5*(a1+emc1);
+ if(fabs(a1-emc1)<=CA*a1)break;
+ emc1*=a1;
+ a1=c1;
+ }
+ u1*=c1;
+ sr=sin(u1);
+ cr=cos(u1);
+ if(sr)
+ {
+ a1=cr/sr;
+ c1*=a1;
+ for(ii1=l1;ii1>=1;ii1--)
+ {
+ b1=em1[ii1];
+ a1*=c1;
+ c1*=dr;
+ dr=(en1[ii1]+a1)/(b1+a1);
+ a1=c1/b1;
+ }
+ a1=1.0/sqrt(c1*c1+1.0);
+ sr=(sr>=0.0?a1:-a1);
+ cr=c1*(sr);
+ }
+ if(bo1)
+ {
+ a1=dr;
+ dr=cr;
+ cr=a1;
+ sr/=d1;
+ }
+ }
+ else
+ {
+ cr=1.0/cosh(u1);
+ dr=cr;
+ sr=tanh(u1);
+ }
+ ////////////////////////////////////////////////////////////////
+ double si,ci,di;
+ //Performing Elleptic Function operation for the imaginary values
+ double a,b,c,d,emc,u;
+ double em[14],en[14];
+ int i,ii,l,bo;
+ //double s1,c1,d1;
+ emc=emmc;
+ u=uui;
+ if(emc)
+ {
+ bo=(emc<0.0);
+ if(bo)
+ {
+ d=1.0-emc;
+ emc/=-1.0/d;
+ u*=(d=sqrt(d));
+ }
+ a=1.0;
+ di=1.0;
+ for(i=1;i<=13;i++)
+ {
+ l=i;
+ em[i]=a;
+ en[i]=(emc=sqrt(emc));
+ c=0.5*(a+emc);
+ if(fabs(a-emc)<=CA*a)break;
+ emc*=a;
+ a=c;
+ }
+ u*=c;
+ si=sin(u);
+ ci=cos(u);
+ if(si)
+ {
+ a=ci/si;
+ c*=a;
+ for(ii=l;ii>=1;ii--)
+ {
+ b=em[ii];
+ a*=c;
+ c*=di;
+ di=(en[ii]+a)/(b+a);
+ a=c/b;
+ }
+ a=1.0/sqrt(c*c+1.0);
+ si=(si>=0.0?a:-a);
+ ci=c*(si);
+ }
+ if(bo)
+ {
+ a=di;
+ di=ci;
+ ci=a;
+ si/=d;
+ }
+ }
+ else
+ {
+ ci=1.0/cosh(u);
+ di=ci;
+ si=tanh(u);
+ }
+ /////////////////////////////////////////////////////////
+ double delta;
+ delta=ci*ci + emmc*sr*sr*si*si;
+ double snir,snii;
+ snir=(sr*di)/delta;
+ snii=(cr*dr*si*ci)/delta;
+ ans=DoubleComplex(snir,snii);
+ return ans;
+}
diff --git a/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c
index 33f22af9..7b9fe9b4 100644
--- a/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c
+++ b/2.3-1/src/c/signalProcessing/zpbutt/dzpbutts.c
@@ -12,6 +12,7 @@
#include<stdio.h>
#include<math.h>
#include "zpbutt.h"
+#include "doubleComplex.h"
#define PI 3.14159265
double dzpbutts(double n,double fl,doubleComplex* out)
{
diff --git a/2.3-1/src/c/string/ascii/gasciia.c b/2.3-1/src/c/string/ascii/gasciia.c
index ec11d6e2..5fe95e07 100644
--- a/2.3-1/src/c/string/ascii/gasciia.c
+++ b/2.3-1/src/c/string/ascii/gasciia.c
@@ -14,12 +14,12 @@
into its ascii equivalent.
*/
#include "ascii.h"
-void gasciia(char *str,int size,int* oup)
+void gasciia(char *str,int size,uint8* oup)
{
int i;
for(i=0;i<size;i++)
{
- *(oup+i)=(int)str[i];
+ *(oup+i)=str[i];
}
}
diff --git a/2.3-1/src/c/string/includes/ascii.h b/2.3-1/src/c/string/includes/ascii.h
index fcf969da..39aeb835 100644
--- a/2.3-1/src/c/string/includes/ascii.h
+++ b/2.3-1/src/c/string/includes/ascii.h
@@ -17,7 +17,7 @@
extern "C" {
#endif
-void gasciia(char* str,int size,int* oup);
+void gasciia(char* str,int size,uint8* oup);
void dasciia(double* inp,int size,char* oup);
#ifdef __cplusplus
diff --git a/2.3-1/src/c/string/strcspn/gstrcspna.c b/2.3-1/src/c/string/strcspn/gstrcspna.c
index b611fff8..2c83c724 100644
--- a/2.3-1/src/c/string/strcspn/gstrcspna.c
+++ b/2.3-1/src/c/string/strcspn/gstrcspna.c
@@ -16,11 +16,11 @@ uint8 gstrcspna(char *str1,int size1,char *str2,int size2)
{
int ind,i,j;
- for(i=0;i<=size1;i++)
+ for(i=0;i<=size2;i++)
{
- for(j=0;j<=size2;j++)
+ for(j=0;j<=size1;j++)
{
- if(str2[j]==str1[i])
+ if(str2[i]==str1[j])
{
ind=j;
break;