cancel
Showing results for 
Search instead for 
Did you mean: 

Mistakes in blueNRG c code?

Serge Ivanyuk
Associate II

I suppose there are some mistake in Blenrg Code

Statement: * @arg FIFO_LEV_1_64: interrupt when Tx FIFO becomes <= 1/64 full = 1 ... at the line 440 of blueNRG1_uart.c is misleading. In accordance to datesheet instead of "full" should be "empty". In the datasheet for the TXFIFO buffer: 000b: Interrupt when FIFO ≥ 1/64 empty. (page 67 of BleuNRG2 datasheet).

3 REPLIES 3
rnone
Associate II

Hello Serge,

TXIFLSEL: Isn't it the size of the bitfield ? The value 3 seems OK to me.

As for FIFO empty and "whole stuffs sent, comprising last stop bit", there seems to be two distinct interrupts (See 3.9.2.6 page 60 on DS12166 Rev 5).

Serge Ivanyuk
Associate II

Sorry I was wrong about TXIFLSEL. But unfortunately, I can't change/edit or delete this my message.

rnone
Associate II

No problem. Anyway, the provided code is often much more examples (hence bottom-up design) you need to reachitect and harden to get production quality code. For instance: no timeouts, assumptions on values, hidden limitations, pushdowns, etc... (and unfortunetly factored with various proprietary bloatware IDE's (read: "carefully designed to obfuscate things") so extraction/cleanup pass to start with).

One really good point is that macro names and fields matches the datasheets so it eases reading and understanding.