v79
11/07/2020, 8:58 AMtypedef enum
{
BCM2835_GPIO_FSEL_INPT = 0x00,
...
} bcm2835FunctionSelect;
I have added this as a strictEnum to `libbcm.def`:
strictEnums = bcm2835FunctionSelect
Then when I try to use it in Kotlin code, there are two issues. Firstly, I have to use it rather verbosely:
bcm2835_gpio_fsel(pin, bcm2835FunctionSelect.BCM2835_GPIO_FSEL_INPT.value.toUByte());
And secondly it doesn't compile, with the following error:
e: kotlin.UninitializedPropertyAccessException: Parent not initialized: org.jetbrains.kotlin.ir.declarations.impl.IrEnumEntryImpl@31d85176
at org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.getParent(IrDeclarationBase.kt:39)
at org.jetbrains.kotlin.ir.util.IrUtilsKt.getParentAsClass(IrUtils.kt:286)
at org.jetbrains.kotlin.backend.konan.ir.interop.cenum.CEnumCompanionGenerator.generateAliasGetterBody(CEnumCompanionGenerator.kt:84)
It looks like I've found a bug, but maybe I'm doing something wrong?v79
11/07/2020, 9:23 AMstrictEnums
from libbcm.def then bcm2835FunctionSelect.BCM2835_GPIO_FSEL_INPT
isn't found at all.dazza5000
11/07/2020, 5:15 PMdazza5000
11/07/2020, 5:16 PMnapperley
11/08/2020, 2:13 AMdazza5000
11/08/2020, 2:34 AMmsink
11/08/2020, 5:28 AMv79
11/08/2020, 10:24 AMv79
11/08/2020, 10:27 AMsergey.bogolepov
11/08/2020, 1:52 PMIf I removeIt is generated as constantfrom libbcm.def thenstrictEnums
isn't found at all.bcm2835FunctionSelect.BCM2835_GPIO_FSEL_INPT
const val BCM2835_GPIO_FSEL_INPT: bcm2835FunctionSelect
.v79
11/08/2020, 3:37 PMsergey.bogolepov
11/10/2020, 8:14 AMnonStrictEnums
property in def file to force const val
generation.sergey.bogolepov
11/10/2020, 8:23 AM