projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
String table and localization stuff.
[bertos.git]
/
drv
/
ser_dsp56k.c
diff --git
a/drv/ser_dsp56k.c
b/drv/ser_dsp56k.c
index 901362d8b7394bd0a4e94e86fc9975f9fa9e76d5..db299ba2d5dbac00730327d973bb88e0978ca193 100755
(executable)
--- a/
drv/ser_dsp56k.c
+++ b/
drv/ser_dsp56k.c
@@
-15,6
+15,12
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.11 2005/01/25 07:42:04 bernie
+ *#* Simplify.
+ *#*
+ *#* Revision 1.10 2005/01/14 00:48:33 aleph
+ *#* Rename callbacks; SerialHardwareVT.txSending: New callback.
+ *#*
*#* Revision 1.9 2004/12/08 09:42:55 bernie
*#* Add support for multiplexed serial ports.
*#*
*#* Revision 1.9 2004/12/08 09:42:55 bernie
*#* Add support for multiplexed serial ports.
*#*
@@
-109,33
+115,36
@@
static inline void disable_rx_irq_bare(volatile struct REG_SCI_STRUCT* regs)
static inline void disable_tx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
static inline void disable_tx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
- volatile struct REG_SCI_STRUCT* regs = hw->regs;
- disable_tx_irq_bare(regs);
+ disable_tx_irq_bare(
hw->
regs);
}
static inline void disable_rx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
}
static inline void disable_rx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
- volatile struct REG_SCI_STRUCT* regs = hw->regs;
- disable_rx_irq_bare(regs);
+ disable_rx_irq_bare(
hw->
regs);
}
static inline void enable_tx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
}
static inline void enable_tx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
- volatile struct REG_SCI_STRUCT* regs = hw->regs;
- enable_tx_irq_bare(regs);
+ enable_tx_irq_bare(
hw->
regs);
}
static inline void enable_rx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
}
static inline void enable_rx_irq(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
- volatile struct REG_SCI_STRUCT* regs = hw->regs;
- enable_rx_irq_bare(regs);
+ enable_rx_irq_bare(hw->regs);
+}
+
+static inline bool tx_irq_enabled(struct SerialHardware* _hw)
+{
+ struct SCI* hw = (struct SCI*)_hw;
+
+ return (hw->regs->CR & REG_SCI_CR_TEIE);
}
static void tx_isr(const struct SCI *hw)
}
static void tx_isr(const struct SCI *hw)
@@
-218,16
+227,12
@@
static void cleanup(struct SerialHardware* _hw)
{
struct SCI* hw = (struct SCI*)_hw;
{
struct SCI* hw = (struct SCI*)_hw;
- // Wait until we finish sending everything
- ser_drain(hw->serial);
- ser_purge(hw->serial);
-
// Uninstall the ISRs
disable_rx_irq(_hw);
disable_tx_irq(_hw);
irq_uninstall(hw->irq_tx);
irq_uninstall(hw->irq_rx);
// Uninstall the ISRs
disable_rx_irq(_hw);
disable_tx_irq(_hw);
irq_uninstall(hw->irq_tx);
irq_uninstall(hw->irq_rx);
-}
+}
static void setbaudrate(struct SerialHardware* _hw, unsigned long rate)
{
static void setbaudrate(struct SerialHardware* _hw, unsigned long rate)
{
@@
-295,9
+300,10
@@
static const struct SerialHardwareVT SCI_VT =
{
.init = init,
.cleanup = cleanup,
{
.init = init,
.cleanup = cleanup,
- .setbaudrate = setbaudrate,
- .setparity = setparity,
- .enabletxirq = enable_tx_irq,
+ .setBaudrate = setbaudrate,
+ .setParity = setparity,
+ .txStart = enable_tx_irq,
+ .txSending = tx_irq_enabled,
};
#if CONFIG_SER_MULTI
};
#if CONFIG_SER_MULTI
@@
-305,9
+311,10
@@
static const struct SerialHardwareVT SCI_MULTI_VT =
{
.init = init_lock,
.cleanup = cleanup_unlock,
{
.init = init_lock,
.cleanup = cleanup_unlock,
- .setbaudrate = setbaudrate,
- .setparity = setparity,
- .enabletxirq = enable_tx_irq,
+ .setBaudrate = setbaudrate,
+ .setParity = setparity,
+ .txStart = enable_tx_irq,
+ .txSending = tx_irq_enabled,
};
#endif /* CONFIG_SER_MULTI */
};
#endif /* CONFIG_SER_MULTI */