Missing macro definitions/demo fails to build

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Post Reply
lungj
Posts: 8
Joined: Wed Feb 03, 2016 7:57 am
Been thanked: 1 time

Missing macro definitions/demo fails to build

Post by lungj »

chSequentialStreamRead and chSequentialStreamPut are used in shell.c but are no longer defined anywhere in the trunk. I checked to see if my build system was off by attempting to build the demo RT-STM32F407-DISCOVERY-MEMS, but that also results in

Code: Select all

../../../os/various/shell/shell.c: In function 'shellGetLine':
../../../os/various/shell/shell.c:234:5: warning: implicit declaration of function 'chSequentialStreamRead' [-Wimplicit-function-declaration]
     if (chSequentialStreamRead(chp, (uint8_t *)&c, 1) == 0)
     ^
../../../os/various/shell/shell.c:242:9: warning: implicit declaration of function 'chSequentialStreamPut' [-Wimplicit-function-declaration]
         chSequentialStreamPut(chp, c);
         ^


Previously, these were defined as

Code: Select all

/**
 * @brief   Sequential Stream read.
 * @details The function reads data from a stream into a buffer.
 *
 * @param[in] ip        pointer to a @p BaseSequentialStream or derived class
 * @param[out] bp       pointer to the data buffer
 * @param[in] n         the maximum amount of data to be transferred
 * @return              The number of bytes transferred. The return value can
 *                      be less than the specified number of bytes if an
 *                      end-of-file condition has been met.
 *
 * @api
 */
#define chSequentialStreamRead(ip, bp, n) ((ip)->vmt->read(ip, bp, n))

/**
 * @brief   Sequential Stream blocking byte write.
 * @details This function writes a byte value to a channel. If the channel
 *          is not ready to accept data then the calling thread is suspended.
 *
 * @param[in] ip        pointer to a @p BaseSequentialStream or derived class
 * @param[in] b         the byte value to be written to the channel
 *
 * @return              The operation status.
 * @retval Q_OK         if the operation succeeded.
 * @retval Q_RESET      if an end-of-file condition has been met.
 *
 * @api
 */
#define chSequentialStreamPut(ip, b) ((ip)->vmt->put(ip, b))


Cheers,
jonathan lung
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Missing macro definitions/demo fails to build

Post by Giovanni »

Hi,

Thanks for pointing out, streams have been removed from the kernel, now those are in HAL with different API name.

Giovanni
Post Reply