"error #28: expression must have a constant value" - with nRF51822 app_twi
m_buffer is defined as a global in the main program, therefore there is no need to pass it into the lsm303_read function. Doing this means that the m_buffer pointer is not constant at compile time.

Changing the function definition to take no argument resolves the problem:

void LSM303_read(void)