示例#1
0
static void
at86rf230_write_frame_complete(void *context)
{
	struct at86rf230_state_change *ctx = context;
	struct at86rf230_local *lp = ctx->lp;

	ctx->trx.len = 2;

	if (gpio_is_valid(lp->slp_tr))
		at86rf230_slp_tr_rising_edge(lp);
	else
		at86rf230_async_write_reg(lp, RG_TRX_STATE, STATE_BUSY_TX, ctx,
					  NULL);
}
示例#2
0
static void
at86rf230_write_frame_complete(void *context)
{
    struct at86rf230_state_change *ctx = context;
    struct at86rf230_local *lp = ctx->lp;
    u8 *buf = ctx->buf;
    int rc;

    ctx->trx.len = 2;

    if (gpio_is_valid(lp->slp_tr)) {
        at86rf230_slp_tr_rising_edge(lp);
    } else {
        buf[0] = (RG_TRX_STATE & CMD_REG_MASK) | CMD_REG | CMD_WRITE;
        buf[1] = STATE_BUSY_TX;
        ctx->msg.complete = NULL;
        rc = spi_async(lp->spi, &ctx->msg);
        if (rc)
            at86rf230_async_error(lp, ctx, rc);
    }
}