Search found 3754 matches

by TJF
May 18, 2022 8:53
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

My code for the SETDATAOUT and CLEARDATAOUT registers is working reliable for years. I see no reason why you should need to invert anything. I guess you're facing multiple bugs compensating themself sometimes. In order to help, I need to check the complete source code (ie a reduced fragment, demonst...
by TJF
May 16, 2022 17:48
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

Hi aotta! First of all, for having some result, i had to use Cleardataout inverted from Setdataout, so i wrote: Io->Gpio->Conf(2)->SETDATAOUT AND= mask Io->Gpio->Conf(2)->CLEARDATAOUT OR= NOT mask ... Second question: OE seems work when GPIO set as input and after changed by OE register, but doesn't...
by TJF
Apr 11, 2022 3:53
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

(i wget it from your debian jessie site and installed with dpkg -i) That's not the latest version. It isn't prepared for the 4.19 kernel, in which a sysfs path changed. As a work-around you can create a symlink in folder /sys/kernel/debug/pinctrl/ named 44e10800.pinmux pointing to folder 44e10800.p...
by TJF
Apr 10, 2022 16:14
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

i had LKM service working, but i had to use custom dtbo for pinmuxing the usr3 led. So, with LKM there's a different way to pinmuxing? i didn't find any example using this module, so i'll have to study more... Just remove the custom dtbo file from the /boot/uEnv.txt file. When the LKM is realy work...
by TJF
Apr 10, 2022 16:01
Forum: General
Topic: Communicate with other program (solved)
Replies: 12
Views: 594

Re: Communicate with other program (solved)

I use shared memory for inter process communication on LINUX. It's based on C-lib, so should also work on other platforms. Both apps have to run on the same OS. Example including semaphores (= write protection, but it's faster let each app write to its own memory area, so no handshake is necessary) ...
by TJF
Apr 10, 2022 15:23
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

... i installed LKM and a custom dtbo made with dts_custom.bas ... Once you have the LKM working, you wont need a custom dtbo. You can do any pinmuxing without dtbo. But finally, when the used pins are defined and you designed your PCB, you should generate and install a custom dtbo just claiming th...
by TJF
Apr 10, 2022 7:36
Forum: Libraries & Headers
Topic: libpruio (BB D/A - I/O fast and easy)
Replies: 406
Views: 114897

Re: libpruio (BB D/A - I/O fast and easy)

Hi aotta, welcome to the forum! 1.bas run fine with showing values, SOS start and write to console the chars but i've no usr led blinking! It seems that you have the uio_pruss driver working (in /boot/uEnv.txt), but no pinmuxing capability. I recommend to install the LKM (loadable kernel module) sol...
by TJF
Apr 06, 2022 19:09
Forum: Beginners
Topic: C opaque struct
Replies: 15
Views: 497

Re: C opaque struct

You wont find guides to translate from C to FB. You'll have to learn the syntax of both languages, try and test your translation, and then write and publish your own guide. typedef struct foo_ctx foo_ctx; declares a pointer to a structure with private context (unknown members). Doesn't fbfrog provid...
by TJF
Apr 06, 2022 15:39
Forum: Beginners
Topic: C function typedef
Replies: 5
Views: 278

Re: C function typedef

Sorry, h_2_bi output is

Code: Select all

' typedef int foo(int x, int y);
TYPE foo AS FUNCTION CDECL(BYVAL AS LONG, BYVAL AS LONG) AS LONG
CDECL takes care of the matching calling convention. You can omit it by enclosing the TYPE in an EXTERN "C" ... END EXTERN block.
by TJF
Apr 06, 2022 15:23
Forum: Beginners
Topic: C function typedef
Replies: 5
Views: 278

Re: C function typedef

typedef int foo(int x, int y); is a function prototype and translates to TYPE foo AS FUNCTION(BYVAL AS LONG, BYVAL AS LONG)AS LONG Note: int (32 bit in C) translates to LONG in order to work on 32- and 64-bit FB code. Perhaps you want to check h_2_bi for such translations. Install it in Geany IDE a...
by TJF
Apr 06, 2022 4:33
Forum: General
Topic: [SOLVED] Pass UTF-8 strings
Replies: 35
Views: 1312

Re: [SOLVED] Pass UTF-8 strings

Imagine you have this valid source in any encoding: var s = "test 中国語" rtlib_func( s ) What kind of encoding (bytes in memory) should rtlib_func() expect to receive and why? When there is no BOM, the source reads as ASCII, one byte per character. In this case the Hànzì characters in the s...
by TJF
Apr 05, 2022 11:37
Forum: Libraries & Headers
Topic: [Windows] Small GUI Library by Henri Serindat
Replies: 2
Views: 332

Re: Small GUI Library by Henri Serindat

From my point of view it would be helpful if you add a note in the subject that you're not talking about a cross-platform, but a platform specific library (naming that platform).
by TJF
Apr 05, 2022 11:13
Forum: General
Topic: [SOLVED] Pass UTF-8 strings
Replies: 35
Views: 1312

Re: [SOLVED] Pass UTF-8 strings

BTW you were right. Geany is the best editor for FreeBASIC. OK (for now). Let us talk again when you got familiar with the basics and you had time to evaluate the sugar features (ie custom commands). And please forgive me that I didn't check your assumption regarding the fbc bug. First I concentrat...
by TJF
Apr 04, 2022 11:02
Forum: General
Topic: [SOLVED] Pass UTF-8 strings
Replies: 35
Views: 1312

Re: Pass UTF-8 strings

If there is a BOM (including UTF-8), the string is converted to a WSTRING depending on platform and the original UTF-8 encoding is lost. Windows -> UTF16LE Linux -> UTF32LE Big Endian ->UTF32BE This is a bug in fbc! The BOM can be either two, three or four bytes. It should get (platform independant...
by TJF
Apr 03, 2022 12:58
Forum: General
Topic: [SOLVED] Pass UTF-8 strings
Replies: 35
Views: 1312

Re: Pass UTF-8 strings

uint16* C_STR$0; C_STR$0 = (uint16*)L"test \x4E2D\x56FD\x8A9E"; This confirms my asumption. In case of an UTF-8 source file you'll get C_STR$0 = (uint8*)"test \xE4\xB8\xAD\xE5\x9B\xBD\xE8\xAA\x9E"; Note: your characters are two bytes in length, the UTF-8 encoded characters are t...