mirror of https://github.com/joan2937/pigpio
Skip wave padding when size = 0
This commit is contained in:
parent
f4a4b9772f
commit
58c5ad756b
7
pigpio.c
7
pigpio.c
|
@ -3130,10 +3130,13 @@ static int wave2Cbs(unsigned wave_mode, int *CB, int *BOOL, int *TOOL, int size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (size)
|
||||||
|
{
|
||||||
/* pad the wave */
|
/* pad the wave */
|
||||||
|
|
||||||
botCB = *CB + NUM_WAVE_CBS / size - 1;
|
botCB = *CB + NUM_WAVE_CBS / size - 1;
|
||||||
botOOL = *BOOL + NUM_WAVE_OOL / size - 1;
|
botOOL = *BOOL + NUM_WAVE_OOL / size - 1;
|
||||||
//topOOL = *TOOL - (NUM_WAVE_OOL / size / 8);
|
//topOOL = //Fix: Ignore topOOL, flags not supported.
|
||||||
|
|
||||||
/* link the last CB to end of wave */
|
/* link the last CB to end of wave */
|
||||||
|
|
||||||
|
@ -3147,7 +3150,7 @@ static int wave2Cbs(unsigned wave_mode, int *CB, int *BOOL, int *TOOL, int size)
|
||||||
p->dst = ((GPIO_BASE + (GPSET0*4)) & 0x00ffffff) | PI_PERI_BUS;
|
p->dst = ((GPIO_BASE + (GPSET0*4)) & 0x00ffffff) | PI_PERI_BUS;
|
||||||
p->length = 4;
|
p->length = 4;
|
||||||
p->next = 0;
|
p->next = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue